Skip to content

Commit ff670fa

Browse files
madebrsezero
authored andcommitted
cmake+xcode: add exports file for Apple
1 parent 3071e49 commit ff670fa

File tree

6 files changed

+675
-2
lines changed

6 files changed

+675
-2
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- { name: Windows (MSVC), os: windows-latest, shell: sh, cmake: '-DPerl_ROOT=C:/Strawberry/perl/bin/ -DSDLMIXER_VENDORED=ON -GNinja', msvc: 1, shared: 1, static: 0, artifact: 'SDL3_mixer-VC-x64' }
1919
- { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64, shared: 1, static: 0, artifact: 'SDL3_mixer-mingw64',
2020
cmake: '-DSDLMIXER_VENDORED=OFF -G "Ninja Multi-Config"' }
21-
- { name: Linux, os: ubuntu-latest, shell: sh, cmake: '-DSDLMIXER_VENDORED=ON -GNinja', shared: 1, static: 0, artifact: 'SDL3_mixer-linux-x64' }
21+
- { name: Linux, os: ubuntu-latest, shell: sh, cmake: '-DSDLMIXER_VENDORED=ON -GNinja', shared: 1, static: 0, test-exports: true, artifact: 'SDL3_mixer-linux-x64' }
2222
- { name: 'Linux (static)', os: ubuntu-latest, shell: sh, cmake: '-DSDLMIXER_VENDORED=ON -DBUILD_SHARED_LIBS=OFF -GNinja', shared: 0, static: 1, artifact: 'SDL3_mixer-static-linux-x64' }
2323
- { name: Macos, os: macos-latest, shell: sh, cmake: '-DSDLMIXER_VENDORED=ON -GNinja', shared: 1, static: 0, artifact: 'SDL3_mixer-macos' }
2424

@@ -141,6 +141,12 @@ jobs:
141141
run: |
142142
cmake --build build/ --target package
143143
144+
- name: Verify exports files
145+
if: ${{ matrix.platform.test-exports }}
146+
run: |
147+
set -e
148+
python src/genexports.py
149+
git diff --exit-code -- src/SDL_mixer.sym src/SDL_mixer.exports
144150
- name: Verify CMake configuration files
145151
run: |
146152
cmake -S cmake/test -B cmake_config_build \

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,14 @@ if(NOT ANDROID)
279279
VERSION "${SO_VERSION}"
280280
)
281281
if(APPLE)
282-
cmake_minimum_required(VERSION 3.17...3.28)
283282
set_target_properties(${sdl3_mixer_target_name} PROPERTIES
284283
MACHO_COMPATIBILITY_VERSION "${DYLIB_COMPAT_VERSION}"
285284
MACHO_CURRENT_VERSION "${DYLIB_CURRENT_VERSION}"
286285
)
286+
set_property(TARGET ${sdl3_mixer_target_name} APPEND PROPERTY LINK_DEPENDS
287+
"${PROJECT_SOURCE_DIR}/src/SDL_mixer.exports")
288+
target_link_options(${sdl3_mixer_target_name} PRIVATE
289+
"SHELL:-Wl,-exported_symbols_list,${PROJECT_SOURCE_DIR}/src/SDL_mixer.exports")
287290
endif()
288291
endif()
289292
if(SDLMIXER_BUILD_SHARED_LIBS)

Xcode/SDL_mixer.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@
618618
00B7E48D097EC6B300826121 /* Debug */ = {
619619
isa = XCBuildConfiguration;
620620
buildSettings = {
621+
EXPORTED_SYMBOLS_FILE = "$(SRCROOT)/../src/SDL_mixer.exports";
621622
};
622623
name = Debug;
623624
};
@@ -724,6 +725,7 @@
724725
F3B38D58296F8E79005DA6D3 /* Release */ = {
725726
isa = XCBuildConfiguration;
726727
buildSettings = {
728+
EXPORTED_SYMBOLS_FILE = "$(SRCROOT)/../src/SDL_mixer.exports";
727729
};
728730
name = Release;
729731
};

src/SDL_mixer.exports

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# SDL3_mixer.dylib exports
2+
_MIX_Init
3+
_MIX_Quit
4+
_MIX_Version
5+
_MIX_CreateMixer
6+
_MIX_CreateMixerDevice
7+
_MIX_DestroyMixer
8+
_MIX_GetNumAudioDecoders
9+
_MIX_GetAudioDecoder
10+
_MIX_GetMixerFormat
11+
_MIX_LoadAudio_IO
12+
_MIX_LoadAudio
13+
_MIX_LoadAudioWithProperties
14+
_MIX_LoadRawAudio_IO
15+
_MIX_LoadRawAudio
16+
_MIX_LoadRawAudioNoCopy
17+
_MIX_CreateSineWaveAudio
18+
_MIX_GetAudioProperties
19+
_MIX_DestroyAudio
20+
_MIX_CreateTrack
21+
_MIX_DestroyTrack
22+
_MIX_SetTrackAudio
23+
_MIX_SetTrackAudioStream
24+
_MIX_SetTrackIOStream
25+
_MIX_SetTrackRawIOStream
26+
_MIX_TagTrack
27+
_MIX_UntagTrack
28+
_MIX_SetTrackPlaybackPosition
29+
_MIX_GetTrackPlaybackPosition
30+
_MIX_TrackMSToFrames
31+
_MIX_TrackFramesToMS
32+
_MIX_AudioMSToFrames
33+
_MIX_AudioFramesToMS
34+
_MIX_MSToFrames
35+
_MIX_FramesToMS
36+
_MIX_PlayTrack
37+
_MIX_PlayTag
38+
_MIX_PlayAudio
39+
_MIX_StopTrack
40+
_MIX_StopAllTracks
41+
_MIX_StopTag
42+
_MIX_PauseTrack
43+
_MIX_PauseAllTracks
44+
_MIX_PauseTag
45+
_MIX_ResumeTrack
46+
_MIX_ResumeAllTracks
47+
_MIX_ResumeTag
48+
_MIX_TrackPlaying
49+
_MIX_TrackPaused
50+
_MIX_SetMasterGain
51+
_MIX_GetMasterGain
52+
_MIX_SetTrackGain
53+
_MIX_GetTrackGain
54+
_MIX_SetTagGain
55+
_MIX_SetTrackFrequencyRatio
56+
_MIX_GetTrackFrequencyRatio
57+
_MIX_SetTrackOutputChannelMap
58+
_MIX_SetTrackStoppedCallback
59+
_MIX_CreateGroup
60+
_MIX_SetTrackGroup
61+
_MIX_DestroyGroup
62+
_MIX_GetGroupMixer
63+
_MIX_GetTrackMixer
64+
_MIX_SetPostMixCallback
65+
_MIX_SetGroupPostMixCallback
66+
_MIX_SetTrackRawCallback
67+
_MIX_SetTrackCookedCallback
68+
_MIX_Generate
69+
_MIX_GetAudioDuration
70+
_MIX_TrackLooping
71+
_MIX_GetTrackAudio
72+
_MIX_GetTrackAudioStream
73+
_MIX_GetTrackRemaining
74+
_MIX_SetTrack3DPosition
75+
_MIX_GetTrack3DPosition
76+
_MIX_GetAudioFormat
77+
_MIX_GetMixerProperties
78+
_MIX_GetTrackProperties
79+
_MIX_GetGroupProperties
80+
_MIX_SetTrackStereo
81+
_MIX_CreateAudioDecoder
82+
_MIX_CreateAudioDecoder_IO
83+
_MIX_DestroyAudioDecoder
84+
_MIX_GetAudioDecoderProperties
85+
_MIX_DecodeAudio
86+
_MIX_GetAudioDecoderFormat
87+
# extra symbols go here (don't modify this line)

src/SDL_mixer.sym

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,6 @@ SDL3_mixer_0.0.0 {
8585
MIX_GetAudioDecoderProperties;
8686
MIX_DecodeAudio;
8787
MIX_GetAudioDecoderFormat;
88+
# extra symbols go here (don't modify this line)
8889
local: *;
8990
};

0 commit comments

Comments
 (0)