Skip to content

Commit c2757cb

Browse files
committed
cmake: add exports file for Apple
1 parent a09d1ca commit c2757cb

File tree

5 files changed

+621
-1
lines changed

5 files changed

+621
-1
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ jobs:
7676
cmake --install build/ --config Release
7777
echo "SDL3_net_ROOT=$(pwd)/prefix" >> $GITHUB_ENV
7878
( cd prefix; find . ) | LC_ALL=C sort -u
79+
80+
- name: Verify exports files
81+
if: ${{ matrix.platform.test-exports }}
82+
run: |
83+
set -e
84+
python src/genexports.py
85+
git diff --exit-code -- src/SDL_net.sym src/SDL_net.exports
7986
- name: Verify CMake configuration files
8087
run: |
8188
cmake -S cmake/test -B cmake_config_build \

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,15 @@ if(NOT ANDROID)
158158
VERSION "${SO_VERSION}"
159159
)
160160
if(APPLE)
161-
cmake_minimum_required(VERSION 3.17...3.28)
162161
set_target_properties(${sdl3_net_target_name} PROPERTIES
163162
MACHO_COMPATIBILITY_VERSION "${DYLIB_COMPAT_VERSION}"
164163
MACHO_CURRENT_VERSION "${DYLIB_CURRENT_VERSION}"
165164
)
166165
sdl_no_deprecated_errors(${sdl3_net_target_name})
166+
set_property(TARGET ${sdl3_net_target_name} APPEND PROPERTY LINK_DEPENDS
167+
"${PROJECT_SOURCE_DIR}/src/SDL_net.exports")
168+
target_link_options(${sdl3_net_target_name} PRIVATE
169+
"SHELL:-Wl,-exported_symbols_list,${PROJECT_SOURCE_DIR}/src/SDL_net.exports")
167170
endif()
168171
endif()
169172
if(SDLNET_BUILD_SHARED_LIBS)

src/SDL_net.exports

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# SDL3_net.dylib exports
2+
_NET_AcceptClient
3+
_NET_CompareAddresses
4+
_NET_CreateClient
5+
_NET_CreateDatagramSocket
6+
_NET_CreateServer
7+
_NET_DestroyDatagram
8+
_NET_DestroyDatagramSocket
9+
_NET_DestroyServer
10+
_NET_DestroyStreamSocket
11+
_NET_FreeLocalAddresses
12+
_NET_GetAddressStatus
13+
_NET_GetAddressString
14+
_NET_GetConnectionStatus
15+
_NET_GetLocalAddresses
16+
_NET_GetStreamSocketAddress
17+
_NET_GetStreamSocketPendingWrites
18+
_NET_Version
19+
_NET_Init
20+
_NET_Quit
21+
_NET_ReadFromStreamSocket
22+
_NET_ReceiveDatagram
23+
_NET_RefAddress
24+
_NET_ResolveHostname
25+
_NET_SendDatagram
26+
_NET_SimulateAddressResolutionLoss
27+
_NET_SimulateDatagramPacketLoss
28+
_NET_SimulateStreamPacketLoss
29+
_NET_UnrefAddress
30+
_NET_WaitUntilConnected
31+
_NET_WaitUntilInputAvailable
32+
_NET_WaitUntilResolved
33+
_NET_WaitUntilStreamSocketDrained
34+
_NET_WriteToStreamSocket
35+
# extra symbols go here (don't modify this line)

src/SDL_net.sym

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@ SDL3_net_0.0.0 {
3333
NET_WaitUntilResolved;
3434
NET_WaitUntilStreamSocketDrained;
3535
NET_WriteToStreamSocket;
36+
# extra symbols go here (don't modify this line)
3637
local: *;
3738
};

0 commit comments

Comments
 (0)