Files
AnyPS5/core/libs/prx/libSceNgs2.native/Ngs2Library.cmake
T
Kyon b3e7819ae0 feat(ngs2): add externally scheduled render jobs
Implement manager lifecycle, dependency batches, the default worker pool and callback/state publication. Keep unsupported worker control buffering and stream routing explicit.
2026-10-26 03:31:08 +00:00

44 lines
1.9 KiB
CMake

function(add_sce_ngs2_library target)
set(ngs2Dir ${CMAKE_CURRENT_FUNCTION_LIST_DIR})
add_library(${target} SHARED EXCLUDE_FROM_ALL
${ngs2Dir}/src/Atrac9.cpp
${ngs2Dir}/src/Custom.cpp
${ngs2Dir}/src/Geom.cpp
${ngs2Dir}/src/Jobs.cpp
${ngs2Dir}/src/Pan.cpp
${ngs2Dir}/src/Pcm.cpp
${ngs2Dir}/src/PitchShift.cpp
${ngs2Dir}/src/Rack.cpp
${ngs2Dir}/src/Render.cpp
${ngs2Dir}/src/Reverb.cpp
${ngs2Dir}/src/Sampler.cpp
${ngs2Dir}/src/System.cpp
${ngs2Dir}/src/Voice.cpp
)
set_property(SOURCE ${ngs2Dir}/src/PitchShift.cpp ${ngs2Dir}/src/Sampler.cpp PROPERTY COMPILE_OPTIONS
"$<$<CXX_COMPILER_ID:GNU,Clang,AppleClang>:-ffp-contract=off>;$<$<CXX_COMPILER_ID:MSVC>:/fp:strict>")
target_include_directories(${target} PRIVATE ${LIBS_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/3rdparty/LibAtrac9/C/src)
target_link_libraries(${target} PRIVATE atrac9 libc libkernel)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_link_options(${target} PRIVATE LINKER:--exclude-libs,ALL)
endif()
set_target_properties(${target} PROPERTIES
CXX_EXTENSIONS OFF
CXX_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN ON
)
configure_windows_unwind(${target})
endfunction()
function(add_sce_ngs2_test library name source)
add_test_executable(${name}_tests ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/tests/${source})
target_include_directories(${name}_tests PRIVATE ${LIBS_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/3rdparty/LibAtrac9/C/src)
target_link_libraries(${name}_tests PRIVATE ${library} atrac9 libkernel libc)
configure_windows_unwind(${name}_tests)
add_test(NAME ${name} COMMAND ${name}_tests)
if(WIN32)
set_tests_properties(${name} PROPERTIES ENVIRONMENT_MODIFICATION
"PATH=path_list_prepend:$<TARGET_FILE_DIR:${library}>")
endif()
endfunction()