diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-07-07 01:04:32 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2020-07-12 23:00:07 +0200 |
commit | 4f85931c42ce4aad454a1dbf38a6f0565822056d (patch) | |
tree | 558b05e353d1b6984d6c9fd4fed80c6bc18fc56b /CMake | |
parent | Funktions (diff) | |
download | cuberite-4f85931c42ce4aad454a1dbf38a6f0565822056d.tar cuberite-4f85931c42ce4aad454a1dbf38a6f0565822056d.tar.gz cuberite-4f85931c42ce4aad454a1dbf38a6f0565822056d.tar.bz2 cuberite-4f85931c42ce4aad454a1dbf38a6f0565822056d.tar.lz cuberite-4f85931c42ce4aad454a1dbf38a6f0565822056d.tar.xz cuberite-4f85931c42ce4aad454a1dbf38a6f0565822056d.tar.zst cuberite-4f85931c42ce4aad454a1dbf38a6f0565822056d.zip |
Diffstat (limited to '')
-rw-r--r-- | CMake/AddDependencies.cmake | 12 | ||||
-rw-r--r-- | CMakeLists.txt | 11 |
2 files changed, 13 insertions, 10 deletions
diff --git a/CMake/AddDependencies.cmake b/CMake/AddDependencies.cmake index ecf18dd27..5173e4487 100644 --- a/CMake/AddDependencies.cmake +++ b/CMake/AddDependencies.cmake @@ -1,4 +1,4 @@ -function(build_dependencies TARGET) +function(build_dependencies) # Set options for SQLiteCpp, disable all their tests and lints: set(SQLITECPP_RUN_CPPLINT OFF CACHE BOOL "Run cpplint.py tool for Google C++ StyleGuide.") set(SQLITECPP_RUN_CPPCHECK OFF CACHE BOOL "Run cppcheck C++ static analysis tool.") @@ -40,6 +40,12 @@ function(build_dependencies TARGET) add_subdirectory("lib/${DEPENDENCY}" EXCLUDE_FROM_ALL) endforeach() + if (WIN32) + add_subdirectory(lib/luaproxy) + endif() +endfunction() + +function(link_dependencies TARGET) # Add required includes: target_include_directories( ${TARGET} SYSTEM PRIVATE @@ -76,8 +82,4 @@ function(build_dependencies TARGET) # Prettify jsoncpp_lib name in VS solution explorer: set_property(TARGET jsoncpp_lib PROPERTY PROJECT_LABEL "jsoncpp") - - if (WIN32) - add_subdirectory(lib/luaproxy) - endif() endfunction() diff --git a/CMakeLists.txt b/CMakeLists.txt index 9931176fe..077a411a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,9 +37,6 @@ include("SetFlags.cmake") # Add build timestamp and details: include("CMake/StampBuild.cmake") -# TODO: set_build_stamp() -set_global_flags() - # We need C++17 features: set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -55,11 +52,15 @@ endif() # Static CRT: set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") +# TODO: set_build_stamp() +set_global_flags() +build_dependencies() + add_executable(${CMAKE_PROJECT_NAME}) add_subdirectory(src) -enable_warnings(${CMAKE_PROJECT_NAME}) -build_dependencies(${CMAKE_PROJECT_NAME}) +set_exe_flags(${CMAKE_PROJECT_NAME}) +link_dependencies(${CMAKE_PROJECT_NAME}) # Set the startup project to Cuberite, and the debugger dir: set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT ${CMAKE_PROJECT_NAME}) |