2024-10-07 21:47:00 +03:00
|
|
|
project("UnleashedRecompLib")
|
|
|
|
|
|
|
|
add_compile_options(
|
2024-12-21 00:44:05 +03:00
|
|
|
-march=sandybridge
|
|
|
|
-mlzcnt
|
|
|
|
-fno-strict-aliasing
|
2024-10-21 14:22:03 +03:00
|
|
|
)
|
2024-10-07 21:47:00 +03:00
|
|
|
|
2024-12-21 00:44:05 +03:00
|
|
|
if (WIN32)
|
|
|
|
add_compile_options(/fp:strict)
|
|
|
|
else()
|
|
|
|
add_compile_options(-ffp-model=strict)
|
|
|
|
endif()
|
|
|
|
|
2024-10-21 14:22:03 +03:00
|
|
|
target_compile_definitions(PowerRecomp PRIVATE CONFIG_FILE_PATH=\"${CMAKE_CURRENT_SOURCE_DIR}/config/SWA.toml\")
|
2024-10-07 21:47:00 +03:00
|
|
|
|
2024-10-21 14:22:03 +03:00
|
|
|
set(SWA_PPC_RECOMPILED_SOURCES
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_config.h"
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_context.h"
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_func_mapping.cpp"
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_recomp_shared.h"
|
|
|
|
)
|
2024-10-07 21:47:00 +03:00
|
|
|
|
2024-10-21 14:22:03 +03:00
|
|
|
foreach(i RANGE 0 260)
|
|
|
|
list(APPEND SWA_PPC_RECOMPILED_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/ppc/ppc_recomp.${i}.cpp")
|
|
|
|
endforeach()
|
2024-10-20 00:53:16 +03:00
|
|
|
|
2024-10-21 14:22:03 +03:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${SWA_PPC_RECOMPILED_SOURCES}
|
2024-12-21 00:44:05 +03:00
|
|
|
COMMAND $<TARGET_FILE:PowerRecomp>
|
2024-10-29 20:27:12 +03:00
|
|
|
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/private/default.xex" "${CMAKE_CURRENT_SOURCE_DIR}/config/SWA.toml"
|
2024-10-21 14:22:03 +03:00
|
|
|
)
|
2024-10-20 00:53:16 +03:00
|
|
|
|
2024-12-13 21:21:58 +03:00
|
|
|
set(SHADER_RECOMP_ROOT "${SWA_TOOLS_ROOT}/ShaderRecomp/ShaderRecomp")
|
2024-11-29 23:30:48 +03:00
|
|
|
set(SHADER_RECOMP_INCLUDE "${SHADER_RECOMP_ROOT}/shader_common.h")
|
2024-10-29 20:27:12 +03:00
|
|
|
|
2024-10-20 00:53:16 +03:00
|
|
|
target_compile_definitions(ShaderRecomp PRIVATE
|
|
|
|
SHADER_RECOMP_INPUT=\"${CMAKE_CURRENT_SOURCE_DIR}/private\"
|
2024-10-21 14:22:03 +03:00
|
|
|
SHADER_RECOMP_OUTPUT=\"${CMAKE_CURRENT_SOURCE_DIR}/shader/shader_cache.cpp\"
|
2024-10-30 05:07:39 -03:00
|
|
|
SHADER_RECOMP_INCLUDE_INPUT=\"${SHADER_RECOMP_INCLUDE}\"
|
2024-10-29 20:27:12 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
file(GLOB SHADER_RECOMP_SOURCES
|
|
|
|
"${SHADER_RECOMP_ROOT}/*.h"
|
|
|
|
"${SHADER_RECOMP_ROOT}/*.cpp"
|
2024-10-21 14:22:03 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/shader/shader_cache.cpp"
|
2024-12-21 00:44:05 +03:00
|
|
|
COMMAND $<TARGET_FILE:ShaderRecomp>
|
2024-10-29 20:27:12 +03:00
|
|
|
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/private/shader.ar" ${SHADER_RECOMP_SOURCES} ${SHADER_RECOMP_INCLUDE}
|
2024-10-21 14:22:03 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
add_library(UnleashedRecompLib
|
|
|
|
${SWA_PPC_RECOMPILED_SOURCES}
|
|
|
|
"shader/shader_cache.h"
|
|
|
|
"shader/shader_cache.cpp"
|
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories(UnleashedRecompLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
target_precompile_headers(UnleashedRecompLib PUBLIC "ppc/ppc_recomp_shared.h")
|