-
Notifications
You must be signed in to change notification settings - Fork 10
/
CMakeLists.txt
68 lines (58 loc) · 1.64 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
cmake_minimum_required(VERSION 3.19)
project(OMP-SDK LANGUAGES CXX DESCRIPTION "Stable classes to write open.mp components with" VERSION 1)
add_subdirectory(lib/glm)
add_subdirectory(lib/robin-hood-hashing)
add_subdirectory(lib/span-lite)
add_subdirectory(lib/string-view-lite)
add_library(OMP-SDK INTERFACE)
if(MSVC)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
target_compile_options(OMP-SDK INTERFACE
"/fp:strict"
"/arch:SSE2"
)
else()
target_compile_options(OMP-SDK INTERFACE
"/fp:strict"
)
endif()
elseif(UNIX)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
target_compile_options(OMP-SDK INTERFACE
-msse2
-mfpmath=sse
)
else()
if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
target_compile_options(OMP-SDK INTERFACE "-mfpu=neon")
endif()
if(TARGET_BUILD_ARCH)
target_compile_options(OMP-SDK INTERFACE "-march=${TARGET_BUILD_ARCH}")
endif()
endif()
endif()
if (NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
target_compile_options(OMP-SDK INTERFACE
-Werror=format
)
endif()
target_link_libraries(OMP-SDK INTERFACE
glm::glm
robin_hood
span-lite
string-view-lite
)
target_compile_definitions(OMP-SDK INTERFACE
GLM_FORCE_QUAT_DATA_WXYZ
NOMINMAX
nssv_CONFIG_SELECT_STRING_VIEW=nssv_STRING_VIEW_NONSTD
span_CONFIG_SELECT_SPAN=span_SPAN_NONSTD
)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
target_compile_definitions(OMP-SDK INTERFACE GLM_FORCE_SSE2)
else()
target_compile_definitions(OMP-SDK INTERFACE GLM_FORCE_NEON)
endif()
target_include_directories(OMP-SDK INTERFACE include/)
file(GLOB_RECURSE omp_sdk_source_list "*.hpp")
set_property(TARGET OMP-SDK PROPERTY SOURCES ${omp_sdk_source_list})