-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
59 lines (47 loc) · 1.52 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
cmake_minimum_required(VERSION 3.15)
project(Meteor)
set(METEOR_VERSION_MAJOR 1)
set(METEOR_VERSION_MINOR 4)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
enable_language(CXX)
enable_language(ASM_NASM)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBAO REQUIRED ao)
find_library(SFML-GRAPHICS_LIBRARY
NAMES sfml-graphics
)
find_library(SFML-WINDOW_LIBRARY
NAMES sfml-window
)
find_library(SFML-SYSTEM_LIBRARY
NAMES sfml-system
)
if(NOT SFML-GRAPHICS_LIBRARY OR NOT SFML-WINDOW_LIBRARY OR NOT SFML-SYSTEM_LIBRARY)
message(FATAL_ERROR "You must have SFML to compile this")
endif()
option(DISABLE_ASM "Force asm optimizations off")
option(METEOR_ASSERTIONS "Enable assertions")
option(METEOR_TRACE "Enable tracing")
if(METEOR_ASSERTIONS)
add_definitions(-DMETEOR_ASSERTIONS=1)
endif()
if(METEOR_TRACE)
add_definitions(-DMETEOR_TRACE=1)
endif()
if(NOT DISABLE_ASM AND
(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
CMAKE_SYSTEM_PROCESSOR MATCHES "i.86"))
message(STATUS "Enabling asm optimizations")
add_definitions(-DX86_ASM=1)
endif()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer")
# RelWithDebInfo is -O2, I need the same as RELEASE to profile
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELEASE} -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wstrict-aliasing=3")
endif()
add_subdirectory(ameteor)
add_subdirectory(text)