forked from OpenFunscripter/OFS
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
64 lines (53 loc) · 1.88 KB
/
CMakeLists.txt
File metadata and controls
64 lines (53 loc) · 1.88 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
53
54
55
56
57
58
59
60
61
62
63
cmake_minimum_required(VERSION 3.16)
# CMake 4.x compatibility: Allow subprojects to use older minimum versions
if(POLICY CMP0150)
cmake_policy(SET CMP0150 OLD)
endif()
# For CMake 4.x, set minimum policy version to allow older submodules
if(NOT DEFINED CMAKE_POLICY_VERSION_MINIMUM)
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
endif()
project(scripter)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
# =============
# == OPTIONS ==
# =============
option(OFS_PROFILE OFF)
option(OFS_AVX OFF)
option(OFS_BUILD_UNIVERSAL "Build universal binary for macOS (x86_64 + arm64)" OFF)
# macOS specific settings
if(APPLE)
# Set minimum macOS version to 11.0 (Big Sur) for ARM64 support
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "Minimum macOS deployment version")
# On Apple Silicon, build ARM64-only by default for better performance
if(OFS_BUILD_UNIVERSAL)
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "Build architectures for macOS")
message(STATUS "Building universal binary (x86_64 + arm64)")
else()
# Build ARM64-only on Apple Silicon
set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "Build architectures for macOS")
message(STATUS "Building ARM64-only (Apple Silicon native)")
endif()
endif()
if(WIN32)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
if(OFS_AVX)
message("OFS AVX ENABLED")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX")
endif()
endif()
# ====================
# === DEPENDENCIES ===
# ====================
add_subdirectory("lib/")
# =====================
# ==== BUILD-TOOLS ====
# =====================
add_subdirectory("localization/")
# ==============
# ==== SRC ====
# ==============
add_subdirectory("OFS-lib/")
add_subdirectory("src/")