2024-09-08 21:39:04 +06:00
|
|
|
cmake_minimum_required (VERSION 3.20)
|
2024-09-28 22:57:35 +06:00
|
|
|
set(THIRDPARTY_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty)
|
2024-09-07 18:00:09 +06:00
|
|
|
set(CMAKE_CXX_STANDARD 23)
|
2024-09-22 01:51:04 +03:00
|
|
|
set(BUILD_SHARED_LIBS OFF)
|
2024-09-07 18:00:09 +06:00
|
|
|
|
|
|
|
# Enable Hot Reload for MSVC compilers if supported.
|
|
|
|
if (POLICY CMP0141)
|
|
|
|
cmake_policy(SET CMP0141 NEW)
|
|
|
|
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
|
|
|
|
2024-09-30 13:39:47 +06:00
|
|
|
include("cmake/bin2h.cmake")
|
2024-09-18 11:37:50 +03:00
|
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
|
|
tomlplusplus
|
|
|
|
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
|
|
|
|
GIT_TAG v3.4.0
|
|
|
|
)
|
2024-09-18 16:04:52 +03:00
|
|
|
FetchContent_Declare(
|
|
|
|
xxHash
|
|
|
|
GIT_REPOSITORY https://github.com/Cyan4973/xxHash.git
|
|
|
|
GIT_TAG v0.8.2
|
|
|
|
SOURCE_SUBDIR "cmake_unofficial"
|
|
|
|
)
|
2024-09-18 11:37:50 +03:00
|
|
|
FetchContent_MakeAvailable(tomlplusplus)
|
2024-09-18 16:04:52 +03:00
|
|
|
FetchContent_MakeAvailable(xxHash)
|
2024-09-18 11:37:50 +03:00
|
|
|
|
2024-09-08 21:39:04 +06:00
|
|
|
add_subdirectory(${THIRDPARTY_ROOT}/disasm)
|
2024-09-30 13:39:47 +06:00
|
|
|
set(POWERANALYSE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/PowerAnalyse)
|
|
|
|
set(POWERRECOMP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/PowerRecomp)
|
|
|
|
set(POWERUTILS_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/PowerUtils)
|
2024-09-07 18:00:09 +06:00
|
|
|
|
|
|
|
project ("PowerRecomp-ALL")
|
|
|
|
|
2024-09-30 13:39:47 +06:00
|
|
|
add_subdirectory(${POWERANALYSE_ROOT})
|
|
|
|
add_subdirectory(${POWERRECOMP_ROOT})
|
|
|
|
add_subdirectory(${POWERUTILS_ROOT})
|
2024-09-30 09:06:09 +06:00
|
|
|
|
|
|
|
# Only build sample and tests if this is the top level project
|
|
|
|
if (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
|
|
|
|
add_subdirectory(PowerSample)
|
|
|
|
add_subdirectory(PowerTests)
|
|
|
|
endif()
|