mirror of
https://github.com/ProgramSnail/snake_2024.git
synced 2025-12-06 06:28:43 +00:00
58 lines
1.4 KiB
CMake
58 lines
1.4 KiB
CMake
# 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
|
|
)
|
|
|