-
Notifications
You must be signed in to change notification settings - Fork 7.1k
/
Copy pathCMakeLists.txt
106 lines (92 loc) · 2.25 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
# architecture
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set(ARCH_DIR "64-bit")
else()
set(ARCH_DIR "32-bit")
endif()
if(WIN32)
set(AUDIO_SRC
win32/SimpleAudioEngine.cpp
win32/MciPlayer.cpp
win32/MciPlayer.h
)
elseif(APPLE)
elseif(OHOS)
set(AUDIO_SRC
ohos/AudioEngine.cpp
ohos/SimpleAudioEngine.cpp
ohos/AudioEngine-inl.cpp
ohos/CCThreadPool.cpp
ohos/AssetFd.cpp
ohos/AudioDecoder.cpp
ohos/AudioDecoderProvider.cpp
ohos/AudioDecoderSLES.cpp
ohos/AudioDecoderOgg.cpp
ohos/AudioDecoderMp3.cpp
ohos/AudioDecoderWav.cpp
ohos/AudioPlayerProvider.cpp
ohos/AudioResampler.cpp
ohos/AudioResamplerCubic.cpp
ohos/CCData.cpp
ohos/PcmBufferProvider.cpp
ohos/PcmAudioPlayer.cpp
ohos/PcmData.cpp
ohos/PcmAudioService.cpp
ohos/UrlAudioPlayer.cpp
ohos/AudioMixerController.cpp
ohos/AudioMixer.cpp
ohos/mp3reader.cpp
ohos/tinysndfile.cpp
ohos/Track.cpp
ohos/audio_utils/RefCounted.cpp
ohos/audio_utils/Value.cpp
ohos/audio_utils/minifloat.cpp
ohos/audio_utils/primitives.cpp
ohos/utils/Utils.cpp
ohos/utils/CCAudioFileUtilsOhos.cpp
)
else()
set(AUDIO_SRC
linux/SimpleAudioEngineFMOD.cpp
linux/FmodAudioPlayer.cpp
linux/FmodAudioPlayer.h
linux/AudioPlayer.h
)
include_directories(
../../external/linux-specific/fmod/include/${ARCH_DIR}
)
endif()
add_library(audio STATIC
${AUDIO_SRC}
include/Export.h
include/SimpleAudioEngine.h
)
if(OHOS)
include_directories(
../../cocos
../../cocos/platform/ohos
)
target_link_libraries(audio
ext_pvmp3dec
ext_tremolo
)
endif()
if((NOT APPLE) AND (NOT WIN32) AND (NOT OHOS) )
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set(FMOD_LIB "fmodex64")
else()
set(FMOD_LIB "fmodex")
endif()
target_link_libraries(audio
${FMOD_LIB}
)
set_target_properties(audio
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
elseif(WIN32)
target_link_libraries(audio
Winmm
)
endif()