From 5af529cf9c12c495138c39cfc0e6b3771b0593c1 Mon Sep 17 00:00:00 2001 From: programsnail Date: Fri, 26 Jul 2024 22:38:18 +0300 Subject: [PATCH] CMakeLists for cmake build variant --- CMakeLists.txt | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..bb09150 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,58 @@ +# this is the build file for project +# it is autogenerated by the xmake build system. +# do not edit by hand. + +# project +cmake_minimum_required(VERSION 3.15.0) +cmake_policy(SET CMP0091 NEW) +project(game LANGUAGES CXX) + +# target +add_executable(game "") +set_target_properties(game PROPERTIES OUTPUT_NAME "game") +set_target_properties(game PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/build/linux/x86_64/release") +target_include_directories(game PRIVATE + include +) +target_compile_options(game PRIVATE + $<$:-m64> + $<$:-m64> + $<$:-DNDEBUG> + $<$:-DNDEBUG> +) +if(MSVC) + target_compile_options(game PRIVATE -W4) +else() + target_compile_options(game PRIVATE -Wall -Wextra) +endif() +set_target_properties(game PROPERTIES CXX_EXTENSIONS OFF) +target_compile_features(game PRIVATE cxx_std_20) +if(MSVC) + target_compile_options(game PRIVATE $<$:-Ox -fp:fast>) +else() + target_compile_options(game PRIVATE -O3) +endif() +if(MSVC) +else() + target_compile_options(game PRIVATE -fvisibility=hidden) +endif() +if(MSVC) + set_property(TARGET game PROPERTY + MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +endif() +target_link_libraries(game PRIVATE + X11 + xcb + Xau +) +target_link_options(game PRIVATE + -m64 +) +target_sources(game PRIVATE + src/Engine.cpp + src/Game.cpp + src/Canvas.cpp + src/Snake.cpp + src/Text.cpp +) +