-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlatformFamily.cmake
50 lines (42 loc) · 1.46 KB
/
PlatformFamily.cmake
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
set(WINDOWS_FAMILY_SYSTEM_NAMES)
list(APPEND WINDOWS_FAMILY_SYSTEM_NAMES Windows)
list(APPEND WINDOWS_FAMILY_SYSTEM_NAMES WindowsCE)
list(APPEND WINDOWS_FAMILY_SYSTEM_NAMES WindowsPhone)
list(APPEND WINDOWS_FAMILY_SYSTEM_NAMES WindowsStore)
list(APPEND WINDOWS_FAMILY_SYSTEM_NAMES CYGWIN)
list(APPEND WINDOWS_FAMILY_SYSTEM_NAMES MSYS)
if(${CMAKE_SYSTEM_NAME} IN_LIST WINDOWS_FAMILY_SYSTEM_NAMES)
add_compile_definitions(WINDOWS_FAMILY)
set(WINDOWS_FAMILY TRUE)
else()
set(WINDOWS_FAMILY FALSE)
endif()
set(LINUX_FAMILY_SYSTEM_NAMES)
list(APPEND LINUX_FAMILY_SYSTEM_NAMES Android)
list(APPEND LINUX_FAMILY_SYSTEM_NAMES Linux)
list(APPEND LINUX_FAMILY_SYSTEM_NAMES WindowsStore)
if(${CMAKE_SYSTEM_NAME} IN_LIST LINUX_FAMILY_SYSTEM_NAMES)
add_compile_definitions(LINUX_FAMILY)
set(LINUX_FAMILY TRUE)
else()
set(LINUX_FAMILY FALSE)
endif()
set(APPLE_FAMILY_SYSTEM_NAMES)
list(APPEND APPLE_FAMILY_SYSTEM_NAMES Darwin)
list(APPEND APPLE_FAMILY_SYSTEM_NAMES iOS)
list(APPEND APPLE_FAMILY_SYSTEM_NAMES visionOS)
list(APPEND APPLE_FAMILY_SYSTEM_NAMES watchOS)
if(${CMAKE_SYSTEM_NAME} IN_LIST APPLE_FAMILY_SYSTEM_NAMES)
add_compile_definitions(APPLE_FAMILY)
set(APPLE_FAMILY TRUE)
else()
set(APPLE_FAMILY FALSE)
endif()
set(WEB_FAMILY_SYSTEM_NAMES)
list(APPEND WEB_FAMILY_SYSTEM_NAMES Emscripten)
if(${CMAKE_SYSTEM_NAME} IN_LIST WEB_FAMILY_SYSTEM_NAMES)
add_compile_definitions(WEB_FAMILY)
set(WEB_FAMILY TRUE)
else()
set(WEB_FAMILY FALSE)
endif()