Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
name: Linux MUSL x64
runs-on: ubuntu-22.04
container:
image: alpine:3.15
image: alpine:3.20.3

steps:
- name: Checkout CSFML
Expand Down
17 changes: 9 additions & 8 deletions tools/nuget/build.linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,16 @@ SFMLLibDir="$(realpath lib)"

cmake -E env LDFLAGS="-z origin" \
cmake \
'-DBUILD_SHARED_LIBS=1' \
'-DBUILD_SHARED_LIBS=ON' \
'-DCMAKE_BUILD_TYPE=Release' \
"-DCMAKE_INSTALL_PREFIX=$SFMLLibDir" \
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$SFMLLibDir" \
'-DCMAKE_BUILD_WITH_INSTALL_RPATH=1' \
'-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON' \
'-DCMAKE_INSTALL_RPATH=$ORIGIN' \
'-DSFML_BUILD_NETWORK=0' \
'-DSFML_BUILD_NETWORK=OFF' \
"$SFMLDir"

cmake --build . --config Release
cmake --build . --config Release --target install

popd # Pop SFML

Expand All @@ -113,13 +114,13 @@ CSFMLLibDir="$(realpath lib)" # The directory that contains the final CSFML libr

cmake -E env LDFLAGS="-z origin" \
cmake \
"-DSFML_ROOT=$SFMLBuiltDir" \
'-DBUILD_SHARED_LIBS=1' \
"-DSFML_ROOT=$SFMLLibDir" \
'-DBUILD_SHARED_LIBS=ON' \
'-DCMAKE_BUILD_TYPE=Release' \
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$CSFMLLibDir" \
'-DCMAKE_BUILD_WITH_INSTALL_RPATH=1' \
'-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON' \
'-DCMAKE_INSTALL_RPATH=$ORIGIN' \
'-DCSFML_BUILD_NETWORK=0' \
'-DCSFML_BUILD_NETWORK=OFF' \
"$CSFMLDir"
cmake --build . --config Release

Expand Down
2 changes: 1 addition & 1 deletion tools/nuget/build.macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ CSFMLLibDir="$(realpath lib)" # The directory that contains the final CSFML libr

cmake -E env \
cmake -G "Unix Makefiles" \
-D "SFML_ROOT=$SFMLBuiltDir" \
-D "SFML_ROOT=$SFMLLibDir" \
-D 'BUILD_SHARED_LIBS=ON' \
-D 'CMAKE_BUILD_TYPE=Release' \
-D "CMAKE_OSX_ARCHITECTURES=$ARCHITECTURE" \
Expand Down
35 changes: 17 additions & 18 deletions tools/nuget/build.win.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,9 @@ $SFMLDir = (Get-Item .).FullName
switch ($RID) {
'win-x86' {
$SFMLExtLibs = (Get-Item ./extlibs/libs-msvc-universal/x86).FullName
$SFMLAudioExtras = (Get-Item ./extlibs/bin/x86).FullName
}
'win-x64' {
$SFMLExtLibs = (Get-Item ./extlibs/libs-msvc-universal/x64).FullName
$SFMLAudioExtras = (Get-Item ./extlibs/bin/x64).FullName
}
Default {
Write-Error "Unknown RID '$RID'"
Expand All @@ -108,24 +106,25 @@ Remove-Item -Recurse -Force -ErrorAction Ignore "$RID"
New-Push "$RID"



Write-Output "Building SFML"
New-Push SFML

$SFMLBuiltDir = Get-Location # The directory where SFML was built to. Used later to direct cmake when building CSFML
$SFMLInstallDir = Join-Path -Path $SFMLBuiltDir -ChildPath 'install'

cmake `
'-DBUILD_SHARED_LIBS=0' `
'-DBUILD_SHARED_LIBS=ON' `
'-DCMAKE_BUILD_TYPE=Release' `
'-DCMAKE_SYSTEM_VERSION=8.1' `
'-DSFML_USE_STATIC_STD_LIBS=1' `
'-DSFML_BUILD_NETWORK=0' `
'-DSFML_USE_STATIC_STD_LIBS=OFF' `
'-DSFML_BUILD_NETWORK=OFF' `
"-DCMAKE_INSTALL_PREFIX=$SFMLInstallDir" `
"-G$Generator" `
"-A$Architecture" `
$SFMLDir
Ensure-Success

cmake --build . --config Release -- '-verbosity:minimal'
cmake --build . --config Release --target install -- '-verbosity:minimal'
Ensure-Success

Pop-Location # Pop SFML
Expand All @@ -134,15 +133,15 @@ Pop-Location # Pop SFML
# STEP 4: Build CSFML #
# =================== #

Write-Output "Building CSFML using SFML at $SFMLBuiltDir"
Write-Output "Building CSFML using SFML at $SFMLInstallDir"
New-Push CSFML

New-Item -ItemType Directory lib > $null
$CSFMLLibDir = (Get-Item lib).FullName; # The directory where the final CSFML dlls are located

cmake `
"-DSFML_ROOT=$SFMLBuiltDir" `
'-DCSFML_LINK_SFML_STATICALLY=1' `
"-DSFML_ROOT=$SFMLInstallDir" `
'-DCSFML_LINK_SFML_STATICALLY=OFF' `
"-DCMAKE_LIBRARY_PATH=$SFMLExtLibs" `
`
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$CSFMLLibDir" `
Expand All @@ -155,11 +154,11 @@ cmake `
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=$CSFMLLibDir" `
`
'-DCMAKE_SYSTEM_VERSION=8.1' `
'-DSTATIC_STD_LIBS=1' `
'-DSTATIC_STD_LIBS=OFF' `
`
"-DBUILD_SHARED_LIBS=1" `
'-DBUILD_SHARED_LIBS=ON' `
'-DCMAKE_BUILD_TYPE=Release' `
'-DCSFML_BUILD_NETWORK=0' `
'-DCSFML_BUILD_NETWORK=OFF' `
`
"-G$generator" `
"-A$Architecture" `
Expand All @@ -178,21 +177,24 @@ Write-Output "Copying CSFML modules"

<#
.SYNOPSIS
Copies a specific CSFML module into its proper NuGet project
Copies a specific SFML & CSFML module into its proper NuGet project

.DESCRIPTION
This function locates a file named csfml-(module)-3.dll inside of the
folder specified by $CSFMLLibDir and copies it to $OutDir/csfml-(module).dll.

Notice how it removes the "-3" at the end, to make the name compatible with other platforms.

The "-3" prefix is retained for the SFML libraries.

.PARAMETER module
The case-insensitive name of the module to copy.
#>
function Copy-Module($module) {
Write-Output "Copying CSFML $module"
Write-Output "Copying SFML & CSFML $module"

New-Item -ItemType Directory $OutDir -ErrorAction Ignore > $null
Copy-Item "$SFMLInstallDir/bin/sfml-$module-3.dll" "$OutDir" -Force > $null
Copy-Item "$CSFMLLibDir/csfml-$module-3.dll" "$OutDir/csfml-$module.dll" -Force > $null
}

Expand All @@ -201,9 +203,6 @@ Copy-Module 'graphics'
Copy-Module 'system'
Copy-Module 'window'

Write-Output "Copying Audio module extra files"
Copy-Item "$SFMLAudioExtras/*" "$OutDir"

Pop-Location # Pop CSFML
Pop-Location # Pop $RID
Pop-Location # Pop Build
1 change: 1 addition & 0 deletions tools/nuget/docker.fedora-x64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dnf install -y \
xorg-x11-server-devel \
libXrandr-devel \
libXcursor-devel \
libXi-devel \
systemd-devel \
mesa-libEGL-devel \
flac-devel \
Expand Down
2 changes: 1 addition & 1 deletion tools/nuget/docker.linux-musl-x64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ apk add \
libx11-dev \
libxrandr-dev \
libxcursor-dev \
libxi-dev \
eudev-dev \
mesa-dev \
flac-dev \
libogg-dev \
libvorbis-dev \
libpthread-stubs \
cmake \
make \
g++
Expand Down