Skip to content

Commit

Permalink
Merge pull request #15 from opentk/develop
Browse files Browse the repository at this point in the history
glfw 3.4
  • Loading branch information
NogginBops committed Mar 5, 2024
2 parents e9b7b1c + 78a47db commit 9d40a19
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 33 deletions.
32 changes: 7 additions & 25 deletions download_dependencies.ps1
@@ -1,5 +1,4 @@
Param([parameter(Mandatory=$true,Position=0)][String]$GLFW_VERSION,
[parameter(Mandatory=$true,Position=1)][String]$GLFW_SHORT_VERSION)
Param([parameter(Mandatory=$true,Position=0)][String]$GLFW_VERSION)

New-Item -ItemType Directory -Force -Path tmp

Expand Down Expand Up @@ -37,35 +36,18 @@ if (Test-Path tmp/src) {
}
Rename-Item -Path tmp/glfw-$GLFW_VERSION -NewName src

mkdir tmp/src/build-x11
pushd tmp/src/build-x11
cmake -DCMAKE_BUILD_TYPE=Release -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF -DBUILD_SHARED_LIBS=ON ..
mkdir tmp/src/build
Push-Location tmp/src/build
cmake -DCMAKE_BUILD_TYPE=Release -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF -DBUILD_SHARED_LIBS=ON -DGLFW_BUILD_X11=ON -DGLFW_BUILD_WAYLAND=ON ..

if ($LastExitCode -ne 0) {
throw 'GLFW X11 compilation setup failed'
throw 'GLFW compilation setup failed'
}

make -j

if ($LastExitCode -ne 0) {
throw 'GLFW X11 compilation failed'
throw 'GLFW compilation failed'
}

popd

mkdir tmp/src/build-wayland
pushd tmp/src/build-wayland
cmake -DCMAKE_BUILD_TYPE=Release -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF -DBUILD_SHARED_LIBS=ON -DGLFW_USE_WAYLAND=ON ..

if ($LastExitCode -ne 0) {
throw 'GLFW Wayland compilation setup failed'
}

make -j

Rename-Item -Path "src/libglfw.so.$GLFW_SHORT_VERSION" -NewName "libglfw-wayland.so.$GLFW_SHORT_VERSION"
if ($LastExitCode -ne 0) {
throw 'GLFW Wayland compilation failed'
}

popd
Pop-Location
7 changes: 1 addition & 6 deletions glfw-redist.csproj
Expand Up @@ -38,12 +38,7 @@
<Pack>true</Pack>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="tmp/src/build-x11/src/*.so.$(GLFW_SHORT_VERSION)">
<PackagePath>runtimes/linux-x64/native/</PackagePath>
<Pack>true</Pack>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="tmp/src/build-wayland/src/*.so.$(GLFW_SHORT_VERSION)">
<Content Include="tmp/src/build/src/*.so.$(GLFW_SHORT_VERSION)">
<PackagePath>runtimes/linux-x64/native/</PackagePath>
<Pack>true</Pack>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
4 changes: 2 additions & 2 deletions make_nuget.ps1
@@ -1,7 +1,7 @@
param([String]$projectDir, [int]$verBuild)

$ErrorActionPreference = "Stop"
[String]$GLFW_VERSION="3.3.8"
[String]$GLFW_VERSION="3.4"

# The built .so file will end in .so.3.3 for a version like 3.3.7, to get the correct file we need to pass "3.3" to the .csproj
[String]$GLFW_SHORT_VERSION = $GLFW_VERSION.Substring(0, $GLFW_VERSION.LastIndexOf("."))
Expand All @@ -14,7 +14,7 @@ if($currentBranch -eq "develop") {
$buildVersionResult = "0-pre" + (Get-Date).ToUniversalTime().ToString("yyyyMMddHHmmss")
}

./download_dependencies.ps1 $GLFW_VERSION $GLFW_SHORT_VERSION
./download_dependencies.ps1 $GLFW_VERSION


$header = Get-Content([System.IO.Path]::Combine($projectDir, ".\tmp\src\include\GLFW\glfw3.h")) | Out-String
Expand Down

0 comments on commit 9d40a19

Please sign in to comment.