mirror of
https://github.com/ProgramSnail/snake_2024.git
synced 2025-12-05 22:28:41 +00:00
CMakeLists for cmake build variant
This commit is contained in:
parent
7e67a3bd30
commit
5af529cf9c
1 changed files with 58 additions and 0 deletions
58
CMakeLists.txt
Normal file
58
CMakeLists.txt
Normal file
|
|
@ -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
|
||||
$<$<COMPILE_LANGUAGE:C>:-m64>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-m64>
|
||||
$<$<COMPILE_LANGUAGE:C>:-DNDEBUG>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-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 $<$<CONFIG:Release>:-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$<$<CONFIG:Debug>: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
|
||||
)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue