forked from SirMangler/pcsx2
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
95 lines (75 loc) · 2.87 KB
/
CMakeLists.txt
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Setting it to a range tells it that it supports the features on the newer
# versions as well, avoiding setting policies.
cmake_minimum_required(VERSION 3.16...3.25)
# Enabling this cmake policy gets rid of warnings regarding LTO.
cmake_policy(SET CMP0069 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "PCSX2 does not support in-tree builds. Please make a build directory that is not the PCSX2 source directory and generate your CMake project there using either `cmake -B build_directory` or by running cmake from the build directory.")
endif()
# Project Name
project(Pcsx2 C CXX)
# Variable to check that people use the good file
set(TOP_CMAKE_WAS_SOURCED TRUE)
# set module path
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# Write binaries to the bin directory under the build directory.
# This makes it simple to run development builds directly out of the build directory.
if (UNIX AND NOT APPLE)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
endif()
# include some generic functions to ensure correctness of the env
include(Pcsx2Utils)
check_no_parenthesis_in_path()
detect_operating_system()
detect_compiler()
#-------------------------------------------------------------------------------
# Include specific module
include(BuildParameters)
include(SearchForStuff)
# Must be done after SearchForStuff
get_git_version_info()
write_svnrev_h()
# make common
add_subdirectory(common)
# make pcsx2
add_subdirectory(pcsx2)
add_subdirectory(pcsx2-qt)
# Updater is Windows only for now.
if (WIN32)
add_subdirectory(updater)
endif()
# tests
if(ENABLE_TESTS)
add_subdirectory(3rdparty/googletest)
add_subdirectory(tests/ctest)
endif()
# gsrunner
if(ENABLE_GSRUNNER)
if (NOT WIN32)
message(WARNING "GSRunner is only supported on Windows and may not build on your system")
endif()
add_subdirectory(pcsx2-gsrunner)
endif()
#-------------------------------------------------------------------------------
if(NOT IS_SUPPORTED_COMPILER)
message(WARNING "
*************** UNSUPPORTED CONFIGURATION ***************
You are not compiling PCSX2 with a supported compiler.
It may not even build successfully.
PCSX2 only supports the Clang and MSVC compilers.
No support will be provided, continue at your own risk.
*********************************************************")
endif()
if(_M_ARM64)
message(WARNING "
*************** UNSUPPORTED CONFIGURATION ***************
Apple Silicon support in PCSX2 is INCOMPLETE. There are
currently no EE/VU/IOP recompilers, and games will run
VERY slow. There is no date for completion yet, you
should set -DCMAKE_OSX_ARCHITECTURES=x86_64 for now,
unless you want to work on the recompilers.
We also ask that you read https://dont-ship.it/.
*********************************************************")
endif()