aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorNicolas James <Eele1Ephe7uZahRie@tutanota.com>2025-02-12 21:57:46 +1100
committerNicolas James <Eele1Ephe7uZahRie@tutanota.com>2025-02-12 21:57:46 +1100
commite4483eca01b48b943cd0461e24a74ae1a3139ed4 (patch)
treeed58c3c246e3af1af337697695d780aa31f6ad9a /CMakeLists.txt
parent1cc08c51eb4b0f95c30c0a98ad1fc5ad3459b2df (diff)
Update to most recent version (old initial commit)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt63
1 files changed, 13 insertions, 50 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 07f3249..72d837c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,59 +1,22 @@
cmake_minimum_required(VERSION 3.18)
+project(root)
+
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
-project(blockgame_linux)
-
-include_directories(
- src
- /usr/include/freetype2
-)
-
-message (STATUS "Running protobuf precompiler")
-execute_process (
- COMMAND protoc --proto_path=src/shared/net/lib/protobuf
- --cpp_out=src/shared/net/lib/protobuf/
- src/shared/net/lib/protobuf/net.proto
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-)
-
-file (GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS
- "src/*.cc"
-)
-add_executable(blockgame_linux
- ${SOURCE_FILES}
-)
-
-target_compile_options(blockgame_linux PRIVATE
- -Wall -Wextra -Wshadow -Wdouble-promotion -Wformat=2 -Wundef -fno-common
- -Wconversion -Wpedantic -std=c++20 -g3
-
- -O2
- #debug
- #-fstack-protector-strong -fno-omit-frame-pointer #fsanitize=undefined
-
- -Wno-exceptions # noexcept + throw is not an error
-
- # not turning off shadow just so gcc compiling looks good, these are ok
- -Wno-missing-field-initializers -Wno-unknown-pragmas
-)
+set(IS_DEBUG CMAKE_BUILD_TYPE STREQUAL "Debug")
-target_link_libraries(blockgame_linux PRIVATE
- SDL2
- epoxy
- pthread
- freetype
- assimp
- protobuf
- boost_iostreams
- sqlite3
- jemalloc
-)
+add_subdirectory(src/shared)
+add_subdirectory(src/server)
+if (NOT NO_CLIENT)
+ add_subdirectory(src/client)
+endif()
+add_subdirectory(src/dedicated)
-target_link_options(blockgame_linux PRIVATE
- #debug
- #-fstack-protector-strong -fsanitize=undefined
-)
+# TODO lots of duplicated target_compile_options, add a global var to fix this