diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..07f3249 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,59 @@ +cmake_minimum_required(VERSION 3.18) + +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 +) + +target_link_libraries(blockgame_linux PRIVATE + SDL2 + epoxy + pthread + freetype + assimp + protobuf + boost_iostreams + sqlite3 + jemalloc +) + +target_link_options(blockgame_linux PRIVATE + #debug + #-fstack-protector-strong -fsanitize=undefined +) |
