-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
61 lines (55 loc) · 2.31 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
cmake_minimum_required(VERSION 3.5)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 14)
project(ne)
# Convert the value inside CMAKE_SYSTEM_NAME to an all uppercase
# name where all symbols are replaced with underscores.
# "GNU/kFreeBSD" -> "GNU_KFREEBSD", "Windows" -> "WINDOWS", "Emscripten" -> "EMSCRIPTEN"...
# See https://github.com/Kitware/CMake/blob/master/Modules/CMakeDetermineSystem.cmake
string(REGEX REPLACE "[^0-9a-zA-Z]" "_" NE_CORE_PLATFORM ${CMAKE_SYSTEM_NAME})
string(TOUPPER ${NE_CORE_PLATFORM} NE_CORE_PLATFORM)
# Convert the value inside CMAKE_SYSTEM_NAME to a quoted string.
# We guarantee that all names will be at least 8 bytes long by
# appending 7 nulls (+1 for the implicit null in C strings).
# We also guarantee the first 8 bytes will be unique.
# This is currently true for all possible CMAKE_SYSTEM_NAMEs.
# See https://github.com/Kitware/CMake/blob/master/Modules/CMakeDetermineSystem.cmake
string(CONCAT NE_CORE_PLATFORM_NAME "\\" "\"" ${CMAKE_SYSTEM_NAME} "\\0\\0\\0\\0\\0\\0\\0\\" "\"")
add_definitions(-D NE_CORE_PLATFORM_NAME=${NE_CORE_PLATFORM_NAME})
add_definitions(-D NE_CORE_PLATFORM_${NE_CORE_PLATFORM}=1)
# In the future we'll move this to be individual CMake files for each
# package (test will bring them all together) and then this CMake file
# will just exist for convenience of building.
add_executable(
ne
packages/ne_core/ne_core.h
packages/ne_core/ne_core_private.h
packages/ne_core/ne_core.cpp
packages/ne_core/ne_core_platform.hpp
packages/ne_core/ne_core_platform.cpp
packages/ne_io/ne_io.h
packages/ne_io/ne_io.cpp
packages/ne_time/ne_time.h
packages/ne_time/ne_time.cpp
packages/ne_filesystem/ne_filesystem.h
packages/ne_filesystem/ne_filesystem.cpp
packages/test/test.h
packages/test/test.cpp
packages/test_core/test_core.h
packages/test_core/test_core.cpp
packages/test_io/test_io.h
packages/test_io/test_io.cpp
packages/test_time/test_time.h
packages/test_time/test_time.cpp
packages/test_filesystem/test_filesystem.h
packages/test_filesystem/test_filesystem.cpp
)
# Enable extra warnings.
if(MSVC)
target_compile_options(ne PRIVATE /W4)
else()
target_compile_options(ne PRIVATE -Wall -Wextra -pedantic)
target_link_libraries(ne PRIVATE -lstdc++fs)
endif()
#target_include_directories(ne directory...)
#target_link_libraries(ne directory...)