summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTycho Bickerstaff <work.tycho@gmail.com>2013-12-19 18:21:29 +0100
committerTycho Bickerstaff <work.tycho@gmail.com>2013-12-19 18:21:29 +0100
commitcb9f30d4eed9a9ad8564104c751884eea1ee787d (patch)
tree6d81ca602f6d0df518a5bdfe590e932fc640561c
parentmodified travis CI file for cmake (diff)
parentfixed include paths on windows and added build dir to gitignore (diff)
downloadcuberite-cb9f30d4eed9a9ad8564104c751884eea1ee787d.tar
cuberite-cb9f30d4eed9a9ad8564104c751884eea1ee787d.tar.gz
cuberite-cb9f30d4eed9a9ad8564104c751884eea1ee787d.tar.bz2
cuberite-cb9f30d4eed9a9ad8564104c751884eea1ee787d.tar.lz
cuberite-cb9f30d4eed9a9ad8564104c751884eea1ee787d.tar.xz
cuberite-cb9f30d4eed9a9ad8564104c751884eea1ee787d.tar.zst
cuberite-cb9f30d4eed9a9ad8564104c751884eea1ee787d.zip
-rw-r--r--.gitignore1
-rw-r--r--CMakeLists.txt10
-rw-r--r--lib/tolua++/CMakeLists.txt6
-rw-r--r--src/CMakeLists.txt22
4 files changed, 30 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index b00a88503..c07822b49 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,6 +52,7 @@ install_mainfest.txt
src/MCServer
lib/tolua++/tolua
src/Bindings/Bindings.*
+MCServer.dir/
#win32 cmake stuff
*.vcxproj
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 77ee23cc8..4201602f2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,14 +2,20 @@
cmake_minimum_required (VERSION 2.6)
project (MCServer)
+if(WIN32)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
+endif()
+
set(CMAKE_CXX_FLAGS_BAK ${CMAKE_CXX_FLAGS})
set(CMAKE_C_FLAGS_BAK ${CMAKE_C_FLAGS})
if (UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
else()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w")
+ #remove /W3 from command line -- cannot just cancel it later with /w like in unix because of D9025
+ string(REPLACE "/W3" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ string(REPLACE "/W3" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
endif()
set(CMAKE_BUILD_TYPE_BAK ${CMAKE_BUILD_TYPE})
set(CMAKE_BUILD_TYPE "Release")
diff --git a/lib/tolua++/CMakeLists.txt b/lib/tolua++/CMakeLists.txt
index 877b89076..9a84c05b2 100644
--- a/lib/tolua++/CMakeLists.txt
+++ b/lib/tolua++/CMakeLists.txt
@@ -18,4 +18,8 @@ add_executable(tolua ${BIN_SOURCE})
add_library(tolualib ${LIB_SOURCE})
#m is the standard math librarys
-target_link_libraries(tolua lua m tolualib)
+if(UNIX)
+target_link_libraries(m)
+endif()
+
+target_link_libraries(tolua lua tolualib)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e247df34e..a557b7dac 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -28,7 +28,8 @@ function(includefolder PATH)
"${PATH}/*.cpp"
"${PATH}/*.h"
)
- source_group("Source Files\\${PATH}" FILES ${FOLDER_FILES})
+ source_group("${PATH}" FILES ${FOLDER_FILES})
+
endfunction(includefolder)
foreach(folder ${FOLDERS})
@@ -40,14 +41,23 @@ file(GLOB_RECURSE SOURCE
"*.h"
)
+include_directories("${PROJECT_SOURCE_DIR}")
+
+source_group("" FILES ${SOURCE})
endif()
list(REMOVE_ITEM SOURCE "${PROJECT_SOURCE_DIR}/StackWalker.cpp" "${PROJECT_SOURCE_DIR}/LeakFinder.cpp")
-add_executable(../MCServer/MCServer ${SOURCE})
+if(UNIX)
+ set(EXECUTABLE ../MCServer/MCServer)
+else()
+ set(EXECUTABLE MCServer)
+endif()
+
+add_executable(${EXECUTABLE} ${SOURCE})
-target_link_libraries(../MCServer/MCServer OSSupport HTTPServer iniFile Bindings Items Blocks)
-target_link_libraries(../MCServer/MCServer Protocol Generating WorldStorage jsoncpp cryptopp)
-target_link_libraries(../MCServer/MCServer Mobs Entities Simulator UI zlib lua BlockEntities)
-target_link_libraries(../MCServer/MCServer md5 luaexpat)
+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)