-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
65 lines (50 loc) · 1.3 KB
/
CMakeLists.txt
File metadata and controls
65 lines (50 loc) · 1.3 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
64
65
cmake_minimum_required (VERSION 3.8)
project ("native-system")
if (WIN32)
add_definitions(/utf-8)
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
set(CMAKE_CXX_FLAGS_RELEASE -Ofast)
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -O3 -Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wall")
include_directories("src/")
if(WIN32)
include_directories("C:/Windows/System32/include")
include_directories("C:/Windows/System32/include/sys")
link_directories("C:/Windows/System32/lib")
link_directories("C:/Windows/System32/lib/sys")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
include_directories("/Users/Shared/libs/include/")
link_directories("/Users/Shared/libs/lib")
endif()
set(HEADERS
src/native_system.h
)
set(SOURCES
src/native_system.cpp
)
if(WIN32)
add_library(mman STATIC IMPORTED)
set_property(TARGET mman PROPERTY IMPORTED_LOCATION C:/Windows/System32/lib/mman.lib)
endif()
add_library(native-system STATIC
${SOURCES}
)
if(WIN32)
target_link_libraries(native-system mman)
endif()
if (CMAKE_VERSION VERSION_GREATER 3.12)
set_property(TARGET native-system PROPERTY CXX_STANDARD 20)
endif()
if(WIN32)
set_property(TARGET native-system PROPERTY COMPILE_FLAGS "/EHsc")
endif()
INSTALL(FILES
${HEADERS}
DESTINATION
include
)
INSTALL(TARGETS native-system LIBRARY DESTINATION lib)