Skip to content

Commit 46ce194

Browse files
committed
Remove unnecessary duplicated native libs
1 parent 71c3fea commit 46ce194

File tree

3 files changed

+22
-20
lines changed

3 files changed

+22
-20
lines changed

tools/nuget/CSFML/build/netstandard2.0/CSFML.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
<Project ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<CSFMLIgnoreAnyCPU>true</CSFMLIgnoreAnyCPU>
5+
<!-- Silence warning about the fedora-x64 libraries -->
6+
<NoWarn>NETSDK1206</NoWarn>
57
</PropertyGroup>
68
</Project>

tools/nuget/build.linux.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ cmake --build . --config Release
127127
# STEP 5: Copy result to the NuGet folders #
128128
# ======================================== #
129129

130+
SFMLMajorMinor="2.6"
131+
CSFMLMajorMinor="2.6"
132+
130133
# Copies one SFML and CSFML module into the NuGet package
131134
# The module name must be passed to this function as an argument, in lowercase
132135
# This function then copies $SFMLLibDir/libsfml-(module).so and
@@ -137,14 +140,15 @@ copymodule()
137140

138141
mkdir -p "$OutDir"
139142

140-
# Note the wildcard at the end of the first argument
141-
# We are copying every versioned file here, not just the .so
142-
# (libsfml-audio.so, libsfml-audio.so.2, libsfml-audio.so.2.6, etc)
143-
# This is needed because of the way linux searches for libraries based
144-
# one their SONAME
145-
cp "$SFMLLibDir/libsfml-$MODULE.so"* "$OutDir"
146-
143+
# SFML.Net only searches for the name with common pre- and suffixes
144+
# As such we need to ship e.g. libcsfml-graphics.so
145+
# But the CSFML libs will look for the major.minor version
146+
# As such we also need to ship e.g. libcsfml-graphics.so.2.6
147+
# Unfortunately NuGet package don't support symlinks: https://github.com/NuGet/Home/issues/10734
148+
# For SFML, we can just ship one version that CSFML will be looking for
149+
cp "$SFMLLibDir/libsfml-$MODULE.so.$SFMLMajorMinor" "$OutDir"
147150
cp "$CSFMLLibDir/libcsfml-$MODULE.so" "$OutDir"
151+
cp "$CSFMLLibDir/libcsfml-$MODULE.so.$CSFMLMajorMinor" "$OutDir"
148152
}
149153

150154
copymodule audio

tools/nuget/build.macos.sh

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -193,19 +193,15 @@ copymodule()
193193

194194
mkdir -p "$OutDir"
195195

196-
# Note the wildcard at the end of the first argument
197-
# We are copying every versioned file here, not just the .dylib
198-
# (libsfml-audio.dylib, libsfml-audio.2.dylib, libsfml-audio.2.6.dylib, etc)
199-
# This is needed because of the way macOS searches for libraries based
200-
# one their SONAME
201-
cp "$SFMLLibDir/libsfml-$MODULE."* "$OutDir"
202-
203-
cp "$CSFMLLibDir/libcsfml-$MODULE."* "$OutDir"
204-
205-
# Fix naming for expected filename
206-
mv "$OutDir/libcsfml-$MODULE.dylib" "$OutDir/libcsfml-$MODULE"
207-
mv "$OutDir/libcsfml-$MODULE.$CSFMLMajorMinor.dylib" "$OutDir/libcsfml-$MODULE.$CSFMLMajorMinor"
208-
mv "$OutDir/libcsfml-$MODULE.$CSFMLMajorMinorPatch.dylib" "$OutDir/libcsfml-$MODULE.$CSFMLMajorMinorPatch"
196+
# SFML.Net only searches for the name with common pre- and suffixes
197+
# As such we need to ship e.g. libcsfml-graphics.dylib
198+
# But the CSFML libs will look for the major.minor version
199+
# As such we also need to ship e.g. libcsfml-graphics.2.6.dylib
200+
# Unfortunately NuGet package don't support symlinks: https://github.com/NuGet/Home/issues/10734
201+
# For SFML, we can just ship one version that CSFML will be looking for
202+
cp "$SFMLLibDir/libsfml-$MODULE.$SFMLMajorMinor.dylib" "$OutDir"
203+
cp "$CSFMLLibDir/libcsfml-$MODULE.dylib" "$OutDir"
204+
cp "$CSFMLLibDir/libcsfml-$MODULE.$CSFMLMajorMinor.dylib" "$OutDir"
209205
}
210206

211207
copymodule audio

0 commit comments

Comments
 (0)