Skip to content

Commit

Permalink
Build SFML dynamically for the windows release packages
Browse files Browse the repository at this point in the history
  • Loading branch information
eXpl0it3r committed Jun 5, 2024
1 parent e153a8a commit 2537d27
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: NuGet Release

on:
push:
branches:
- master
- 2.6.x
push: {}
workflow_dispatch: {}

concurrency:
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
name: Release Builds

on:
push:
branches:
- master
- 2.6.x
tags:
- "**"
push: {}
workflow_dispatch: {}

concurrency:
Expand Down Expand Up @@ -51,12 +46,12 @@ jobs:

- name: Build SFML
run: |
cmake -S SFML -B SFML-build -A Win32 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=FALSE -DSFML_USE_STATIC_STD_LIBS=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/SFML-install -DCMAKE_VERBOSE_MAKEFILE=ON
cmake -S SFML -B SFML-build -A Win32 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/SFML-install -DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build SFML-build --config Release --target install
- name: Build CSFML
run: |
cmake -S CSFML -B CSFML-build -A Win32 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=TRUE -DSTATIC_STD_LIBS=TRUE -DCSFML_LINK_SFML_STATICALLY=TRUE -DCMAKE_BUILD_TYPE=Release -DSFML_DIR=${{ github.workspace }}/SFML-install/lib/cmake/SFML -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/CSFML-install -DCMAKE_VERBOSE_MAKEFILE=ON
cmake -S CSFML -B CSFML-build -A Win32 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=TRUE -DCSFML_LINK_SFML_STATICALLY=FALSE -DCMAKE_BUILD_TYPE=Release -DSFML_DIR=${{ github.workspace }}/SFML-install/lib/cmake/SFML -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/CSFML-install -DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build CSFML-build --config Release --target install
- name: Add MinGW to PATH
Expand Down Expand Up @@ -93,6 +88,7 @@ jobs:
Pop-Location
New-Item -ItemType "directory" -PATH "install"
Move-Item -Path "SFML-install\bin\*" -Destination "install\CSFML"
Move-Item -Path "CSFML-install\*" -Destination "install\CSFML"
- name: Upload Artifact
Expand Down Expand Up @@ -138,12 +134,12 @@ jobs:

- name: Build SFML
run: |
cmake -S SFML -B SFML-build -A x64 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=FALSE -DSFML_USE_STATIC_STD_LIBS=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/SFML-install -DCMAKE_VERBOSE_MAKEFILE=ON
cmake -S SFML -B SFML-build -A x64 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/SFML-install -DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build SFML-build --config Release --target install
- name: Build CSFML
run: |
cmake -S CSFML -B CSFML-build -A x64 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=TRUE -DSTATIC_STD_LIBS=TRUE -DCSFML_LINK_SFML_STATICALLY=TRUE -DCMAKE_BUILD_TYPE=Release -DSFML_DIR=${{ github.workspace }}/SFML-install/lib/cmake/SFML -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/CSFML-install -DCMAKE_VERBOSE_MAKEFILE=ON
cmake -S CSFML -B CSFML-build -A x64 -G "Visual Studio 17 2022" -DBUILD_SHARED_LIBS=TRUE -DCSFML_LINK_SFML_STATICALLY=FALSE -DCMAKE_BUILD_TYPE=Release -DSFML_DIR=${{ github.workspace }}/SFML-install/lib/cmake/SFML -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/CSFML-install -DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build CSFML-build --config Release --target install
- name: Add MinGW to PATH
Expand Down Expand Up @@ -180,6 +176,7 @@ jobs:
Pop-Location
New-Item -ItemType "directory" -PATH "install"
Move-Item -Path "SFML-install\bin\*" -Destination "install\CSFML"
Move-Item -Path "CSFML-install\*" -Destination "install\CSFML"
- name: Upload Artifact
Expand Down
7 changes: 4 additions & 3 deletions tools/nuget/build.win.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ New-Push SFML
$SFMLBuiltDir = Get-Location # The directory where SFML was built to. Used later to direct cmake when building CSFML

cmake `
'-DBUILD_SHARED_LIBS=0' `
'-DBUILD_SHARED_LIBS=1' `
'-DCMAKE_BUILD_TYPE=Release' `
'-DCMAKE_SYSTEM_VERSION=8.1' `
'-DSFML_USE_STATIC_STD_LIBS=1' `
'-DSFML_USE_STATIC_STD_LIBS=0' `
'-DSFML_BUILD_NETWORK=0' `
"-G$Generator" `
"-A$Architecture" `
Expand All @@ -142,7 +142,7 @@ $CSFMLLibDir = (Get-Item lib).FullName; # The directory where the final CSFML dl

cmake `
"-DSFML_DIR=$SFMLBuiltDir" `
'-DCSFML_LINK_SFML_STATICALLY=1' `
'-DCSFML_LINK_SFML_STATICALLY=0' `
"-DCMAKE_LIBRARY_PATH=$SFMLExtLibs" `
`
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=$CSFMLLibDir" `
Expand Down Expand Up @@ -193,6 +193,7 @@ function Copy-Module($module) {
Write-Output "Copying CSFML $module"

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

Expand Down

0 comments on commit 2537d27

Please sign in to comment.