forked from Vita3K/Vita3K
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
55 lines (44 loc) · 1.67 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
cmake_minimum_required(VERSION 3.10)
project(Vita3K)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
option(USE_GDBSTUB "Build Vita3K with GDB Debugger." OFF)
option(USE_DISCORD_RICH_PRESENCE "Build Vita3K with Discord Rich Presence" OFF)
option(USE_VULKAN "Build Vita3K with Vulkan backend." OFF)
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
endif()
enable_testing()
macro(pre_configure_boost)
find_package(Boost COMPONENTS filesystem system program_options QUIET)
if (Boost_FOUND)
set(BOOST_INCLUDEDIR ${Boost_INCLUDE_DIRS})
set(BOOST_LIBRARYDIR ${Boost_LIBRARIES})
else()
message("Setting up ext-boost environment variables")
set(BOOST_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/external/boost")
set(BOOST_INCLUDEDIR "${BOOST_ROOT}/boost")
set(BOOST_LIBRARYDIR "${CMAKE_CURRENT_SOURCE_DIR}/external/boost-build/lib")
endif()
message("Using Boost_VERSION: ${BOOST_ROOT}")
message("Using Boost_INCLUDE_DIRS: ${BOOST_INCLUDEDIR}")
message("Using Boost_LIBRARY_DIRS: ${BOOST_LIBRARYDIR}")
endmacro(pre_configure_boost)
if(NOT CI)
pre_configure_boost()
endif()
if(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
add_definitions (/D "_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS" /D "_CRT_SECURE_NO_WARNINGS")
endif()
if ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mavx -mf16c")
endif()
add_subdirectory(external)
add_subdirectory(vita3k)
add_subdirectory(tools/gen-modules)