-
Notifications
You must be signed in to change notification settings - Fork 28
/
cmake.ysfx.txt
147 lines (140 loc) · 4.67 KB
/
cmake.ysfx.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
140
141
142
143
144
145
146
147
# -*- cmake -*-
# Copyright 2021 Jean Pierre Cimalando
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
# ysfx-private
# A ysfx target which gives access to the internals.
# This target is adequate for unit-testing.
# ------------------------------------------------------------------------------
add_library(ysfx-private
OBJECT
"sources/ysfx.cpp"
"sources/ysfx.hpp"
"sources/ysfx_config.cpp"
"sources/ysfx_config.hpp"
"sources/ysfx_midi.cpp"
"sources/ysfx_midi.hpp"
"sources/ysfx_reader.cpp"
"sources/ysfx_reader.hpp"
"sources/ysfx_parse.cpp"
"sources/ysfx_parse.hpp"
"sources/ysfx_parse_menu.cpp"
"sources/ysfx_parse_menu.hpp"
"sources/ysfx_preset.cpp"
"sources/ysfx_preset.hpp"
"sources/ysfx_audio_wav.cpp"
"sources/ysfx_audio_wav.hpp"
"sources/ysfx_audio_flac.cpp"
"sources/ysfx_audio_flac.hpp"
"sources/ysfx_utils.cpp"
"sources/ysfx_utils.hpp"
"sources/ysfx_utils_fts.cpp"
"sources/ysfx_api_eel.cpp"
"sources/ysfx_api_eel.hpp"
"sources/ysfx_api_reaper.cpp"
"sources/ysfx_api_reaper.hpp"
"sources/ysfx_api_file.cpp"
"sources/ysfx_api_file.hpp"
"sources/ysfx_api_gfx.cpp"
"sources/ysfx_api_gfx.hpp"
"sources/ysfx_api_gfx_dummy.hpp"
"sources/ysfx_api_gfx_lice.hpp"
"sources/ysfx_eel_utils.cpp"
"sources/ysfx_eel_utils.hpp"
"sources/utility/sync_bitset.hpp"
"sources/base64/Base64.hpp")
target_compile_definitions(ysfx-private
PRIVATE
"_FILE_OFFSET_BITS=64")
if(MSVC)
target_compile_definitions(ysfx-private
PRIVATE
"_CRT_NONSTDC_NO_WARNINGS")
endif()
if(WIN32)
target_compile_definitions(ysfx-private
PRIVATE
"NOMINMAX")
endif()
if(NOT YSFX_FTS_IS_AVAILABLE)
target_compile_definitions(ysfx-private
PRIVATE
"YSFX_NO_FTS")
endif()
if(YSFX_FTS_IS_AVAILABLE AND NOT YSFX_FTS_HAS_LFS_SUPPORT)
target_compile_definitions(ysfx-private
PRIVATE
"YSFX_FTS_LACKS_LFS_SUPPORT")
endif()
target_include_directories(ysfx-private
PUBLIC
"include"
"sources")
target_link_libraries(ysfx-private
PUBLIC
eel2
eel2nasm
wdl-base
dr_libs)
if(YSFX_GFX)
target_link_libraries(ysfx-private PUBLIC lice)
else()
target_compile_definitions(ysfx-private PUBLIC "YSFX_NO_GFX")
endif()
# ysfx::ysfx
# A ysfx target which gives access to the public interface.
# This target is adequate for normal use.
# ------------------------------------------------------------------------------
add_library(ysfx STATIC)
target_include_directories(ysfx PUBLIC "include")
target_link_libraries(ysfx PRIVATE
ysfx-private
eel2
eel2nasm
wdl-base)
if(YSFX_GFX)
target_link_libraries(ysfx PUBLIC lice)
endif()
add_library(ysfx::ysfx ALIAS ysfx)
set_property(TARGET ysfx PROPERTY PUBLIC_HEADER "include/ysfx.h")
# generate the function export list
add_custom_command(
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/exports/ysfx.txt"
COMMAND "${CMAKE_COMMAND}" "-P" "${PROJECT_SOURCE_DIR}/cmake/ExtractYsfxExports.cmake"
DEPENDS "${PROJECT_SOURCE_DIR}/cmake/ExtractYsfxExports.cmake"
DEPENDS "include/ysfx.h"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
VERBATIM)
add_custom_target(ysfx-api DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/exports/ysfx.txt")
add_dependencies(ysfx ysfx-api)
# strip the static library, to keep API symbols only (on supported platforms)
if(YSFX_DEEP_STRIP)
# TODO currently broken, don't use
if(NOT APPLE AND NOT WIN32)
if(OBJCOPY_PROGRAM AND RANLIB_PROGRAM)
add_custom_command(
TARGET ysfx POST_BUILD
COMMAND "${OBJCOPY_PROGRAM}" "--keep-symbols=${CMAKE_CURRENT_SOURCE_DIR}/exports/ysfx.txt" "--strip-all" "$<TARGET_FILE:ysfx>"
COMMAND "${RANLIB_PROGRAM}" "$<TARGET_FILE:ysfx>"
VERBATIM)
endif()
endif()
endif()
# install
install(
TARGETS ysfx
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")