summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authortycho <tycho@hanoverdesktop>2013-12-20 17:05:12 +0100
committertycho <tycho@hanoverdesktop>2013-12-20 17:05:12 +0100
commitf739246e52e3385d1e133516fbe32aafeb16911d (patch)
treea7324f40b472117fcee5bbffa8bdb30a95979611 /src/CMakeLists.txt
parentfixed include of math on windows (diff)
downloadcuberite-f739246e52e3385d1e133516fbe32aafeb16911d.tar
cuberite-f739246e52e3385d1e133516fbe32aafeb16911d.tar.gz
cuberite-f739246e52e3385d1e133516fbe32aafeb16911d.tar.bz2
cuberite-f739246e52e3385d1e133516fbe32aafeb16911d.tar.lz
cuberite-f739246e52e3385d1e133516fbe32aafeb16911d.tar.xz
cuberite-f739246e52e3385d1e133516fbe32aafeb16911d.tar.zst
cuberite-f739246e52e3385d1e133516fbe32aafeb16911d.zip
Diffstat (limited to '')
-rw-r--r--src/CMakeLists.txt37
1 files changed, 24 insertions, 13 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9b461ff94..00c3059b5 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -43,17 +43,26 @@ file(GLOB_RECURSE SOURCE
include_directories("${PROJECT_SOURCE_DIR}")
-ADD_CUSTOM_COMMAND(
-#add any new generated bindings here
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Bindings/Bindings.cpp ${CMAKE_CURRENT_BINARY_DIR}/Bindings/Bindings.h
-#command execuded to regerate bindings
- COMMAND tolua -L virtual_method_hooks.lua -o Bindings/Bindings.cpp -H Bindings/Bindings.h AllToLua.pkg
-#add any new generation dependencies here
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/virtual_method_hooks.lua ${CMAKE_CURRENT_SOURCE_DIR}/Bindings/AllToLua.pkg tolua
- )
-
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")
@@ -66,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)