-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
52 lines (41 loc) · 1.61 KB
/
CMakeLists.txt
File metadata and controls
52 lines (41 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
cmake_minimum_required(VERSION 3.21)
project("PS2 Retro X")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(PS2X_RUNTIME OFF)
# ARM64 support using sse2neon
if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm64|aarch64|ARM64")
message(STATUS "ARM64 detected, fetching sse2neon")
include(FetchContent)
FetchContent_Declare(
sse2neon
GIT_REPOSITORY https://github.com/DLTcollab/sse2neon.git
GIT_TAG v1.9.1
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(sse2neon)
include_directories(${sse2neon_SOURCE_DIR})
add_compile_definitions(USE_SSE2NEON)
if(APPLE)
# macOS ARM64 already uses optimal defaults
message(STATUS "macOS ARM64 - using default compiler flags")
elseif(MSVC)
# Windows ARM64 - MSVC already uses optimal defaults
message(STATUS "Windows ARM64 (MSVC) - using default compiler flags")
else()
# Linux ARM64 - add NEON flags
message(STATUS "Non-Apple ARM64 - adding NEON compiler flags")
add_compile_options(-march=armv8-a+fp+simd)
# Try to enable crypto and CRC extensions if supported
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-march=armv8-a+fp+simd+crypto+crc" COMPILER_SUPPORTS_CRYPTO_CRC)
if(COMPILER_SUPPORTS_CRYPTO_CRC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=armv8-a+fp+simd+crypto+crc")
message(STATUS "Crypto and CRC extensions enabled")
endif()
endif()
endif()
add_subdirectory("ps2xRecomp")
add_subdirectory("ps2xRuntime")
add_subdirectory("ps2xAnalyzer")
add_subdirectory("ps2xTest")
add_subdirectory("ps2xStudio")