summaryrefslogtreecommitdiff
path: root/cmake/lib.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/lib.cmake')
-rw-r--r--cmake/lib.cmake10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmake/lib.cmake b/cmake/lib.cmake
index 7c94c732e3..64ceb02bd5 100644
--- a/cmake/lib.cmake
+++ b/cmake/lib.cmake
@@ -1,4 +1,12 @@
-add_library(${TARGET} SHARED ${SOURCES})
+set(STDAFX "${CMAKE_CURRENT_SOURCE_DIR}/src/stdafx.cxx")
+if ((EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/stdafx.h") AND (EXISTS ${STDAFX}))
+ file(GLOB PRECOMPILED_SOURCES "src/*.cpp")
+ SET_SOURCE_FILES_PROPERTIES(${PRECOMPILED_SOURCES} PROPERTIES COMPILE_FLAGS "/Yu")
+ SET_SOURCE_FILES_PROPERTIES(${STDAFX} PROPERTIES COMPILE_FLAGS "/Yc")
+ add_library(${TARGET} SHARED ${STDAFX} ${SOURCES})
+else()
+ add_library(${TARGET} SHARED ${SOURCES})
+endif()
set_target_properties(${TARGET} PROPERTIES
LINK_FLAGS "/SUBSYSTEM:WINDOWS"
SUFFIX ".mir"