release build setup

This commit is contained in:
Till Wübbers
2025-03-16 02:00:33 +01:00
parent 442fd23a0b
commit ebf29b058a
9 changed files with 28 additions and 10 deletions

View File

@@ -2,17 +2,17 @@ cmake_minimum_required(VERSION 3.10)
project(PuzGameProj)
if (MSVC)
else()
add_compile_options(-g -gcodeview)
add_link_options(-fuse-ld=lld -g -Wl,--pdb=)
endif()
add_compile_definitions("$<$<CONFIG:DEBUG>:DEBUG>")
# set the output directory for built objects.
# This makes sure that the dynamic library goes into the build directory automatically.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIGURATION>")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/$<CONFIGURATION>")
set(PROFILE ON)
# Imgui
file(GLOB imgui_sources dependency/imgui/*.h dependency/imgui/*.cpp)
@@ -27,7 +27,6 @@ file(GLOB_RECURSE sources_engine engine/*.cpp engine/*.h)
add_executable(PuzGameEngine ${sources_engine})
target_compile_definitions(PuzGameEngine PUBLIC "_AMD64_")
set_property(TARGET PuzGameEngine PROPERTY CXX_STANDARD 17)
target_include_directories(PuzGameEngine PUBLIC dependency/tracy/public/)
# Game
add_custom_command(
@@ -42,10 +41,11 @@ file(GLOB source_singleheader dependency/tinygltf/stb_image.h dependency/tinyglt
add_library(PuzGame SHARED ${sources_game} ${source_singleheader} ${imgui_sources} ${imgui_backend_sdl})
set_property(TARGET PuzGame PROPERTY CXX_STANDARD 17)
target_include_directories(PuzGame PUBLIC dependency/imgui)
target_include_directories(PuzGame PUBLIC dependency/tracy/public/)
# Profiling
if (PROFILE)
option(TRACY_ENABLE "" ON)
option(TRACY_ENABLE "" OFF)
if (TRACY_ENABLE)
option(TRACY_ON_DEMAND "" ON)
set(TRACY_DELAYED_INIT ON)
set(TRACY_MANUAL_LIFETIME ON)
@@ -61,6 +61,11 @@ SET(BGFX_BUILD_EXAMPLES OFF)
add_subdirectory("${CMAKE_SOURCE_DIR}/dependency/bgfx.cmake")
# Link
if (TRACY_ENABLE)
target_link_libraries(PuzGame bx bimg bgfx SDL3::SDL3 Tracy::TracyClient)
target_link_libraries(PuzGameEngine bx SDL3::SDL3 Tracy::TracyClient)
else()
target_link_libraries(PuzGame bx bimg bgfx SDL3::SDL3)
target_link_libraries(PuzGameEngine bx SDL3::SDL3)
endif()
set_target_properties(PuzGame PROPERTIES OUTPUT_NAME "PuzGame2")