Files
PS2Recomp/ps2xAnalyzer/CMakeLists.txt
Ranieri 7562ec14c9 better analyzer and integrating sce-symbol-scanner (#130)
* feat: modularize elf analyzer
feat: added experimental sce symbol scanner
feat: change analyzer order
feat: small optimizations on analyzer

* feat: remove example_config.toml because its causing confusion on some people

* feat: embed sce symbol but leave optional import path
feat: killed skip function on analyzer but leave it so you can skip manual if you want

* feat: pin elfio tag

* feat: manually create string view with size

* feat: update ghidra script
2026-06-06 23:37:12 -03:00

59 lines
1.4 KiB
CMake

cmake_minimum_required(VERSION 3.20)
project(PS2Analyzer VERSION 0.1.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(FetchContent)
FetchContent_Declare(
nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v3.11.3
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(nlohmann_json)
set(PS2ANALYZER_LIB_SOURCES
src/analysis_passes.cpp
src/elf_analysis_context.cpp
src/elf_analyzer.cpp
src/function_classifier.cpp
src/sce_symbol_scanner.cpp
src/toml_generator.cpp
)
add_library(ps2_analyzer_lib STATIC ${PS2ANALYZER_LIB_SOURCES})
target_include_directories(ps2_analyzer_lib PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/ps2xRecomp/include
${CMAKE_SOURCE_DIR}/ps2xRuntime/include
)
target_link_libraries(ps2_analyzer_lib PUBLIC
ps2_recomp_lib
nlohmann_json::nlohmann_json
)
add_executable(ps2_analyzer
src/analyzer_main.cpp
)
target_link_libraries(ps2_analyzer PRIVATE
ps2_analyzer_lib
)
install(TARGETS ps2_analyzer ps2_analyzer_lib
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
include("${CMAKE_SOURCE_DIR}/ps2xRuntime/cmake/ReleaseMode.cmake")
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
EnableFastReleaseMode(ps2_analyzer_lib)
EnableFastReleaseMode(ps2_analyzer)
endif()