You've already forked aurora
mirror of
https://github.com/CraftyBoss/aurora.git
synced 2026-07-14 05:07:24 -07:00
CMake: Set PROPERTIES FOLDER for all libraries
This commit is contained in:
-126
@@ -81,129 +81,3 @@ if (NOT CMAKE_CROSSCOMPILING)
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
endif ()
|
||||
|
||||
# =============================================================================
|
||||
# aurora_shared: Single SHARED library bundling all Aurora components.
|
||||
# Used for DLL isolation — keeps JSystem's global operator new/delete
|
||||
# confined to the game shared library, away from Dawn/SDL allocations.
|
||||
# =============================================================================
|
||||
add_library(aurora_shared SHARED
|
||||
# aurora_core sources
|
||||
lib/aurora.cpp
|
||||
lib/input.cpp
|
||||
lib/window.cpp
|
||||
lib/logging.cpp
|
||||
# aurora_si sources
|
||||
lib/dolphin/si/si.cpp
|
||||
# aurora_pad sources
|
||||
lib/dolphin/pad/pad.cpp
|
||||
# aurora_vi sources
|
||||
lib/dolphin/vi/vi.cpp
|
||||
# aurora_mtx sources
|
||||
lib/dolphin/mtx/mtx.c
|
||||
lib/dolphin/mtx/mtxstack.c
|
||||
lib/dolphin/mtx/mtxvec.c
|
||||
lib/dolphin/mtx/mtx44.c
|
||||
lib/dolphin/mtx/vec.c
|
||||
lib/dolphin/mtx/quat.c
|
||||
)
|
||||
add_library(aurora::shared ALIAS aurora_shared)
|
||||
|
||||
target_compile_definitions(aurora_shared PUBLIC AURORA TARGET_PC)
|
||||
target_include_directories(aurora_shared PUBLIC include)
|
||||
target_link_libraries(aurora_shared PUBLIC ${AURORA_SDL3_TARGET} fmt::fmt xxhash)
|
||||
target_link_libraries(aurora_shared PRIVATE absl::btree absl::flat_hash_map TracyClient)
|
||||
|
||||
if (AURORA_ENABLE_DVD)
|
||||
target_sources(aurora_shared PRIVATE lib/dolphin/dvd/dvd.cpp)
|
||||
target_link_libraries(aurora_shared PRIVATE nod::nod)
|
||||
endif ()
|
||||
|
||||
if (AURORA_ENABLE_GX)
|
||||
target_sources(aurora_shared PRIVATE
|
||||
# aurora_core GX sources
|
||||
lib/imgui.cpp
|
||||
lib/webgpu/gpu.cpp
|
||||
lib/webgpu/gpu_cache.cpp
|
||||
# aurora_gx sources
|
||||
lib/gfx/clear.cpp
|
||||
lib/gfx/common.cpp
|
||||
lib/gfx/pipeline_cache.cpp
|
||||
lib/gfx/dds_io.cpp
|
||||
lib/gfx/tex_copy_conv.cpp
|
||||
lib/gfx/tex_palette_conv.cpp
|
||||
lib/gfx/texture.cpp
|
||||
lib/gfx/texture_convert.cpp
|
||||
lib/gfx/texture_replacement.cpp
|
||||
lib/gx/command_processor.cpp
|
||||
lib/gx/fifo.cpp
|
||||
lib/gx/gx.cpp
|
||||
lib/gx/pipeline.cpp
|
||||
lib/gx/shader.cpp
|
||||
lib/gx/shader_info.cpp
|
||||
lib/dolphin/gx/GXBump.cpp
|
||||
lib/dolphin/gx/GXCull.cpp
|
||||
lib/dolphin/gx/GXDispList.cpp
|
||||
lib/dolphin/gx/GXDraw.cpp
|
||||
lib/dolphin/gx/GXExtra.cpp
|
||||
lib/dolphin/gx/GXFifo.cpp
|
||||
lib/dolphin/gx/GXFrameBuffer.cpp
|
||||
lib/dolphin/gx/GXGeometry.cpp
|
||||
lib/dolphin/gx/GXGet.cpp
|
||||
lib/dolphin/gx/GXLighting.cpp
|
||||
lib/dolphin/gx/GXManage.cpp
|
||||
lib/dolphin/gx/GXPerf.cpp
|
||||
lib/dolphin/gx/GXPixel.cpp
|
||||
lib/dolphin/gx/GXTev.cpp
|
||||
lib/dolphin/gx/GXTexture.cpp
|
||||
lib/dolphin/gx/GXTransform.cpp
|
||||
lib/dolphin/gx/GXVert.cpp
|
||||
)
|
||||
target_compile_definitions(aurora_shared PUBLIC AURORA_ENABLE_GX)
|
||||
# imgui code is compiled into aurora_shared; link PRIVATE to avoid duplicating the static lib
|
||||
# into downstream targets. Propagate only the include directories for header access.
|
||||
target_link_libraries(aurora_shared PRIVATE imgui sqlite3)
|
||||
if (AURORA_CACHE_USE_ZSTD)
|
||||
target_compile_definitions(aurora_shared PRIVATE AURORA_CACHE_USE_ZSTD)
|
||||
target_link_libraries(aurora_shared PRIVATE libzstd_static)
|
||||
endif ()
|
||||
target_include_directories(aurora_shared PUBLIC $<TARGET_PROPERTY:imgui,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
if (EMSCRIPTEN)
|
||||
target_link_options(aurora_shared PUBLIC -sUSE_WEBGPU=1 -sASYNCIFY -sEXIT_RUNTIME)
|
||||
target_compile_definitions(aurora_shared PRIVATE ENABLE_BACKEND_WEBGPU)
|
||||
else ()
|
||||
target_link_libraries(aurora_shared PRIVATE dawn::webgpu_dawn)
|
||||
target_sources(aurora_shared PRIVATE lib/dawn/BackendBinding.cpp)
|
||||
target_compile_definitions(aurora_shared PRIVATE WEBGPU_DAWN)
|
||||
endif ()
|
||||
if (DAWN_ENABLE_VULKAN)
|
||||
target_compile_definitions(aurora_shared PRIVATE DAWN_ENABLE_BACKEND_VULKAN)
|
||||
endif ()
|
||||
if (DAWN_ENABLE_METAL)
|
||||
target_compile_definitions(aurora_shared PRIVATE DAWN_ENABLE_BACKEND_METAL)
|
||||
target_sources(aurora_shared PRIVATE lib/dawn/MetalBinding.mm)
|
||||
set_source_files_properties(lib/dawn/MetalBinding.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
|
||||
endif ()
|
||||
if (DAWN_ENABLE_D3D11)
|
||||
target_compile_definitions(aurora_shared PRIVATE DAWN_ENABLE_BACKEND_D3D11)
|
||||
endif ()
|
||||
if (DAWN_ENABLE_D3D12)
|
||||
target_compile_definitions(aurora_shared PRIVATE DAWN_ENABLE_BACKEND_D3D12)
|
||||
endif ()
|
||||
if (DAWN_ENABLE_DESKTOP_GL OR DAWN_ENABLE_OPENGLES)
|
||||
target_compile_definitions(aurora_shared PRIVATE DAWN_ENABLE_BACKEND_OPENGL)
|
||||
if (DAWN_ENABLE_DESKTOP_GL)
|
||||
target_compile_definitions(aurora_shared PRIVATE DAWN_ENABLE_BACKEND_DESKTOP_GL)
|
||||
endif ()
|
||||
if (DAWN_ENABLE_OPENGLES)
|
||||
target_compile_definitions(aurora_shared PRIVATE DAWN_ENABLE_BACKEND_OPENGLES)
|
||||
endif ()
|
||||
endif ()
|
||||
if (DAWN_ENABLE_NULL)
|
||||
target_compile_definitions(aurora_shared PRIVATE DAWN_ENABLE_BACKEND_NULL)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Export all symbols from the aurora shared library.
|
||||
# This is safe because aurora has no global operator new/delete overrides.
|
||||
set_target_properties(aurora_shared PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
|
||||
@@ -9,8 +9,8 @@ add_library(aurora_card STATIC
|
||||
lib/card/Util.cpp
|
||||
lib/dolphin/card.cpp
|
||||
)
|
||||
|
||||
add_library(aurora::card ALIAS aurora_card)
|
||||
set_target_properties(aurora_card PROPERTIES FOLDER "aurora")
|
||||
|
||||
target_link_libraries(aurora_card PUBLIC aurora::core)
|
||||
target_include_directories(aurora_card PRIVATE include)
|
||||
|
||||
@@ -5,6 +5,7 @@ add_library(aurora_core STATIC
|
||||
lib/logging.cpp
|
||||
)
|
||||
add_library(aurora::core ALIAS aurora_core)
|
||||
set_target_properties(aurora_core PROPERTIES FOLDER "aurora")
|
||||
|
||||
target_compile_definitions(aurora_core PUBLIC AURORA TARGET_PC)
|
||||
target_include_directories(aurora_core PUBLIC include)
|
||||
|
||||
@@ -2,6 +2,7 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/AuroraNodProvider.cmake)
|
||||
|
||||
add_library(aurora_dvd STATIC lib/dolphin/dvd/dvd.cpp)
|
||||
add_library(aurora::dvd ALIAS aurora_dvd)
|
||||
set_target_properties(aurora_dvd PROPERTIES FOLDER "aurora")
|
||||
|
||||
target_compile_definitions(aurora_dvd PUBLIC AURORA TARGET_PC)
|
||||
target_include_directories(aurora_dvd PUBLIC include)
|
||||
|
||||
@@ -10,7 +10,7 @@ add_library(aurora_gd STATIC
|
||||
lib/dolphin/gd/gd.hpp
|
||||
lib/dolphin/gd/GDAurora.cpp
|
||||
)
|
||||
|
||||
add_library(aurora::gd ALIAS aurora_gd)
|
||||
set_target_properties(aurora_gd PROPERTIES FOLDER "aurora")
|
||||
|
||||
target_link_libraries(aurora_gd PUBLIC aurora::gx)
|
||||
|
||||
@@ -34,6 +34,7 @@ add_library(aurora_gx STATIC
|
||||
lib/dolphin/gx/GXAurora.cpp
|
||||
)
|
||||
add_library(aurora::gx ALIAS aurora_gx)
|
||||
set_target_properties(aurora_gx PROPERTIES FOLDER "aurora")
|
||||
|
||||
target_link_libraries(aurora_gx PUBLIC aurora::core xxhash)
|
||||
target_link_libraries(aurora_gx PRIVATE absl::btree absl::flat_hash_map sqlite3 TracyClient)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
add_library(aurora_main STATIC lib/main.cpp)
|
||||
add_library(aurora::main ALIAS aurora_main)
|
||||
set_target_properties(aurora_main PROPERTIES FOLDER "aurora")
|
||||
|
||||
target_include_directories(aurora_main PUBLIC include)
|
||||
target_link_libraries(aurora_main PUBLIC ${AURORA_SDL3_TARGET})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
add_library(aurora_ms STATIC lib/dolphin/ms/mouse.cpp)
|
||||
|
||||
add_library(aurora::ms ALIAS aurora_ms)
|
||||
set_target_properties(aurora_ms PROPERTIES FOLDER "aurora")
|
||||
|
||||
target_include_directories(aurora_ms PUBLIC include)
|
||||
target_link_libraries(aurora_ms PUBLIC aurora::core)
|
||||
|
||||
@@ -7,5 +7,6 @@ add_library(aurora_mtx STATIC
|
||||
lib/dolphin/mtx/quat.c
|
||||
)
|
||||
add_library(aurora::mtx ALIAS aurora_mtx)
|
||||
set_target_properties(aurora_mtx PROPERTIES FOLDER "aurora")
|
||||
|
||||
target_include_directories(aurora_mtx PUBLIC include)
|
||||
|
||||
@@ -9,6 +9,7 @@ add_library(aurora_os STATIC lib/dolphin/os/OSInit.cpp
|
||||
lib/dolphin/os/OSReport.cpp
|
||||
lib/dolphin/AR.cpp)
|
||||
add_library(aurora::os ALIAS aurora_os)
|
||||
set_target_properties(aurora_os PROPERTIES FOLDER "aurora")
|
||||
|
||||
target_include_directories(aurora_os PUBLIC include)
|
||||
target_link_libraries(aurora_os PRIVATE aurora::core)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
add_library(aurora_pad STATIC lib/dolphin/pad/pad.cpp)
|
||||
|
||||
add_library(aurora::pad ALIAS aurora_pad)
|
||||
set_target_properties(aurora_pad PROPERTIES FOLDER "aurora")
|
||||
|
||||
target_include_directories(aurora_pad PUBLIC include)
|
||||
target_link_libraries(aurora_pad PUBLIC aurora::core aurora::si)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
add_library(aurora_si STATIC lib/dolphin/si/si.cpp)
|
||||
|
||||
add_library(aurora::si ALIAS aurora_si)
|
||||
set_target_properties(aurora_si PROPERTIES FOLDER "aurora")
|
||||
|
||||
target_include_directories(aurora_si PUBLIC include)
|
||||
target_link_libraries(aurora_si PUBLIC aurora::core)
|
||||
|
||||
@@ -2,5 +2,6 @@ add_library(aurora_vi STATIC
|
||||
lib/dolphin/vi/vi.cpp
|
||||
)
|
||||
add_library(aurora::vi ALIAS aurora_vi)
|
||||
set_target_properties(aurora_vi PROPERTIES FOLDER "aurora")
|
||||
|
||||
target_link_libraries(aurora_vi PUBLIC aurora::core)
|
||||
|
||||
Reference in New Issue
Block a user