This commit is contained in:
Asuro
2025-02-08 18:54:09 +01:00
parent 149de529e6
commit aa18ffd1a5
8 changed files with 285 additions and 339 deletions

View File

@@ -5,9 +5,15 @@ if (MSVC)
else()
add_compile_options(-g -gcodeview)
add_link_options(-fuse-ld=lld -g -Wl,--pdb=)
add_link_options(-g -Wl,--pdb=)
# add_link_options(-fuse-ld=lld -g -Wl,--pdb=)
endif()
# 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>")
# Engine
file(GLOB_RECURSE sources_engine engine/*.cpp engine/*.h)
add_executable(PuzGameEngine ${sources_engine})
@@ -22,11 +28,15 @@ file(GLOB_RECURSE sources_game game/*.cpp game/*.h)
add_library(PuzGame SHARED ${sources_game})
set_property(TARGET PuzGame PROPERTY CXX_STANDARD 17)
# SDL
add_subdirectory("${CMAKE_SOURCE_DIR}/dependency/SDL" EXCLUDE_FROM_ALL)
# BGFX
SET(BGFX_BUILD_TOOLS ON)
SET(BGFX_BUILD_EXAMPLES ON)
SET(BGFX_BUILD_EXAMPLES OFF)
#SET(BGFX_CONFIG_MULTITHREADED OFF)
add_subdirectory("${CMAKE_SOURCE_DIR}/dependency/bgfx.cmake")
target_link_libraries(PuzGame bx bimg bgfx)
target_link_libraries(PuzGame bx bimg bgfx SDL3::SDL3)
target_link_libraries(PuzGameEngine bx)
set_target_properties(PuzGame PROPERTIES OUTPUT_NAME "PuzGame2")