This commit is contained in:
Asuro
2025-03-14 22:07:44 +01:00
parent a3e22b7b05
commit a5e32c414e
5 changed files with 236 additions and 185 deletions

View File

@@ -12,6 +12,7 @@ endif()
# 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)
@@ -25,7 +26,7 @@ add_subdirectory("${CMAKE_SOURCE_DIR}/dependency/minidef")
file(GLOB_RECURSE sources_engine engine/*.cpp engine/*.h)
add_executable(PuzGameEngine ${sources_engine})
set_property(TARGET PuzGameEngine PROPERTY CXX_STANDARD 17)
target_include_directories(PuzGameEngine PUBLIC)
target_include_directories(PuzGameEngine PUBLIC dependency/tracy/public/)
# Game
add_custom_command(
@@ -41,6 +42,15 @@ add_library(PuzGame SHARED ${sources_game} ${source_singleheader} ${imgui_source
set_property(TARGET PuzGame PROPERTY CXX_STANDARD 17)
target_include_directories(PuzGame PUBLIC dependency/imgui)
# Profiling
if (PROFILE)
option(TRACY_ENABLE "" ON)
option(TRACY_ON_DEMAND "" ON)
set(TRACY_DELAYED_INIT ON)
set(TRACY_MANUAL_LIFETIME ON)
add_subdirectory("${CMAKE_SOURCE_DIR}/dependency/tracy")
endif()
# SDL
add_subdirectory("${CMAKE_SOURCE_DIR}/dependency/SDL" EXCLUDE_FROM_ALL)
@@ -50,6 +60,6 @@ SET(BGFX_BUILD_EXAMPLES OFF)
add_subdirectory("${CMAKE_SOURCE_DIR}/dependency/bgfx.cmake")
# Link
target_link_libraries(PuzGame bx bimg bgfx SDL3::SDL3)
target_link_libraries(PuzGameEngine bx SDL3::SDL3)
target_link_libraries(PuzGame bx bimg bgfx SDL3::SDL3 Tracy::TracyClient)
target_link_libraries(PuzGameEngine bx SDL3::SDL3 Tracy::TracyClient)
set_target_properties(PuzGame PROPERTIES OUTPUT_NAME "PuzGame2")