diff options
| -rw-r--r-- | CMakeLists.txt | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ebaaae2..4942736 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.7.0) +cmake_minimum_required(VERSION 3.31.0) project(AttorneyOnline VERSION 2.11.0.0 LANGUAGES CXX C) @@ -11,8 +11,8 @@ set(CMAKE_AUTOUIC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) -option(AO_BUILD_TESTS "Build test programs" ON) -option(AO_ENABLE_DISCORD_RPC "Enable Discord Rich Presence" ON) +option(AO_BUILD_TESTS "Build test programs" OFF) +option(AO_ENABLE_DISCORD_RPC "Enable Discord Rich Presence" OFF) find_package(QT NAMES Qt6) find_package(Qt6 REQUIRED COMPONENTS Core Gui Network Widgets Concurrent WebSockets UiTools) @@ -105,6 +105,22 @@ qt_add_executable(Attorney_Online src/network/serverinfo.h src/network/serverinfo.cpp ) +if(CMAKE_BUILD_TYPE STREQUAL "Dev") + target_compile_definitions(Attorney_Online PRIVATE NETWORK_DEBUG) + target_compile_options(Attorney_Online PRIVATE -O0 -Wall -Wextra -pedantic) +endif() + +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + target_compile_definitions(Attorney_Online PRIVATE NETWORK_DEBUG) + target_compile_options(Attorney_Online PRIVATE -O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address) + target_link_options(Attorney_Online PRIVATE -g -fsanitize=address) +endif() + +if(CMAKE_BUILD_TYPE STREQUAL "Release") + target_compile_options(Attorney_Online PRIVATE -O3 -pipe -fno-plt -fno-semantic-interposition -fvisibility=hidden -flto -fno-rtti -fno-exceptions -Werror=odr -Werror=strict-aliasing) + target_link_options(Attorney_Online PRIVATE -Wl,-O2 -Wl,--as-needed -flto -fuse-ld=lld) +endif() + set_target_properties(Attorney_Online PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin") if(WIN32) |
