summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a557b7dac..00c3059b5 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -45,6 +45,24 @@ include_directories("${PROJECT_SOURCE_DIR}")
source_group("" FILES ${SOURCE})
+#precompiledheaders
+
+file(GLOB_RECURSE HEADERS
+ "*.h"
+)
+
+foreach(header ${HEADERS})
+ set(FLAGS "/Yu ${header} /Yc ${header}")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS}")
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAGS}")
+ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${FLAGS}")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${FLAGS}")
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${FLAGS}")
+ set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_PROFILE} ${FLAGS}")
+ set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} ${FLAGS}")
+endforeach()
+
endif()
list(REMOVE_ITEM SOURCE "${PROJECT_SOURCE_DIR}/StackWalker.cpp" "${PROJECT_SOURCE_DIR}/LeakFinder.cpp")
@@ -57,7 +75,9 @@ endif()
add_executable(${EXECUTABLE} ${SOURCE})
-target_link_libraries(${EXECUTABLE} OSSupport HTTPServer iniFile Bindings Items Blocks)
-target_link_libraries(${EXECUTABLE} Protocol Generating WorldStorage jsoncpp cryptopp)
-target_link_libraries(${EXECUTABLE} Mobs Entities Simulator UI zlib lua BlockEntities)
-target_link_libraries(${EXECUTABLE} md5 luaexpat)
+if(NOT WIN32)
+target_link_libraries(${EXECUTABLE} OSSupport HTTPServer Bindings Items Blocks)
+target_link_libraries(${EXECUTABLE} Protocol Generating WorldStorage)
+target_link_libraries(${EXECUTABLE} Mobs Entities Simulator UI BlockEntities)
+endif()
+target_link_libraries(${EXECUTABLE} md5 luaexpat iniFile jsoncpp cryptopp zlib lua)