This repository has been archived by the owner on Mar 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
139 lines (116 loc) · 3.92 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
cmake_minimum_required(VERSION 3.19)
include(npm.cmake)
project(auph-static)
set(CMAKE_CXX_STANDARD 17)
option(AUPH_WAV "Auph WAV format support" ON)
option(AUPH_MP3 "Auph MP3 format support" ON)
option(AUPH_OGG "Auph OGG format support" ON)
add_library(${PROJECT_NAME} STATIC auph-static.cpp)
if (AUPH_WAV)
target_compile_definitions(${PROJECT_NAME} PUBLIC AUPH_WAV)
endif ()
if (AUPH_MP3)
target_compile_definitions(${PROJECT_NAME} PUBLIC AUPH_MP3)
endif ()
if (AUPH_OGG)
target_compile_definitions(${PROJECT_NAME} PUBLIC AUPH_OGG)
endif ()
target_include_directories(${PROJECT_NAME} PUBLIC include)
target_compile_options(${PROJECT_NAME}
PUBLIC -Os
PUBLIC -ffast-math
PUBLIC -fno-exceptions
PUBLIC -fno-rtti
PUBLIC -Wall
PUBLIC -Wextra
)
target_link_options(${PROJECT_NAME}
PUBLIC -Os
)
target_link_libraries(${PROJECT_NAME}
PUBLIC dr-libs
PUBLIC stb
)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_compile_options(${PROJECT_NAME}
PUBLIC -x objective-c++
)
target_link_libraries(${PROJECT_NAME}
PUBLIC "-framework Foundation"
PUBLIC "-framework CoreAudio"
PUBLIC "-framework AudioToolbox"
)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "iOS")
target_compile_options(${PROJECT_NAME}
PUBLIC -x objective-c++
)
target_link_libraries(${PROJECT_NAME}
PUBLIC "-framework Foundation"
PUBLIC "-framework AVFoundation"
PUBLIC "-framework AudioToolbox"
)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Android")
target_include_directories(${PROJECT_NAME}
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/android/oboe/include
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/android/oboe/src
)
target_link_libraries(${PROJECT_NAME}
INTERFACE log
)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
endif ()
if (EMSCRIPTEN)
target_link_options(${PROJECT_NAME}
PUBLIC SHELL:--pre-js ${CMAKE_CURRENT_SOURCE_DIR}/web/dist/emscripten/auph.js
)
elseif (ANDROID)
target_include_directories(${PROJECT_NAME}
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/android/oboe/include
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/android/oboe/src
)
target_link_libraries(${PROJECT_NAME}
PUBLIC log
)
endif ()
project(auph)
add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(${PROJECT_NAME} INTERFACE include)
target_link_libraries(${PROJECT_NAME}
INTERFACE dr-libs
INTERFACE stb
)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_compile_options(${PROJECT_NAME}
INTERFACE -x objective-c++
)
target_link_libraries(${PROJECT_NAME}
INTERFACE "-framework Foundation"
INTERFACE "-framework CoreAudio"
INTERFACE "-framework AudioToolbox"
)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "iOS")
target_compile_options(${PROJECT_NAME}
INTERFACE -x objective-c++
)
target_link_libraries(${PROJECT_NAME}
INTERFACE "-framework Foundation"
INTERFACE "-framework AVFoundation"
INTERFACE "-framework AudioToolbox"
)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Android")
target_include_directories(${PROJECT_NAME}
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/android/oboe/include
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/android/oboe/src
)
target_link_libraries(${PROJECT_NAME}
INTERFACE log
)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
endif ()
if (EMSCRIPTEN)
target_link_options(${PROJECT_NAME}
INTERFACE SHELL:--pre-js ${CMAKE_CURRENT_SOURCE_DIR}/web/dist/emscripten/auph.js
)
endif ()