Skip to content

Commit f8a558c

Browse files
jdolanclaude
andcommitted
sdl3.targets: serialize SDL3 download with a mutex
Parallel multi-project builds (e.g. quetoo_all.sln with msbuild /m) import this target into several projects at once, racing on the same download. Guard the fetch with a named mutex and an inner existence re-check so only one project downloads and the rest skip. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 016d296 commit f8a558c

15 files changed

Lines changed: 32 additions & 30 deletions

ObjectivelyGPU.vs15/sdl3.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
Condition="!Exists('$(SDL3Dir)include\SDL3\SDL.h')">
2626
<Message Importance="high" Text="Downloading SDL3 $(SDL3Version) development libraries..." />
2727
<Exec WorkingDirectory="$(MSBuildThisFileDirectory)"
28-
Command="powershell -NoProfile -ExecutionPolicy Bypass -Command &quot;$ErrorActionPreference = 'Stop'; New-Item -ItemType Directory -Force libs | Out-Null; Invoke-WebRequest -Uri 'https://github.com/libsdl-org/SDL/releases/download/release-$(SDL3Version)/SDL3-devel-$(SDL3Version)-VC.zip' -OutFile 'libs\sdl3.zip'; Expand-Archive -Force 'libs\sdl3.zip' 'libs'; Remove-Item 'libs\sdl3.zip'&quot;" />
28+
Command="powershell -NoProfile -ExecutionPolicy Bypass -Command &quot;$ErrorActionPreference = 'Stop'; $m = New-Object System.Threading.Mutex($false, 'Global\ObjectivelySDL3'); [void]$m.WaitOne(); try { if (-not (Test-Path '$(SDL3Dir)include\SDL3\SDL.h')) { New-Item -ItemType Directory -Force libs | Out-Null; Invoke-WebRequest -Uri 'https://github.com/libsdl-org/SDL/releases/download/release-$(SDL3Version)/SDL3-devel-$(SDL3Version)-VC.zip' -OutFile 'libs\sdl3.zip'; Expand-Archive -Force 'libs\sdl3.zip' 'libs'; Remove-Item 'libs\sdl3.zip' } } finally { $m.ReleaseMutex() }&quot;" />
2929
</Target>
3030

3131
</Project>

Sources/ObjectivelyGPU.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* ObjectivelyGPU: SDL3 GPU wrapper for Objectively and GNU C.
3-
* Copyright (C) 2014 Jay Dolan <jay@jaydolan.com>
2+
* ObjectivelyGPU: Object oriented graphics framework for SDL3 and GNU C.
3+
* Copyright (C) 2026 Jay Dolan <jay@jaydolan.com>
44
*
55
* This software is provided 'as-is', without any express or implied
66
* warranty. In no event will the authors be held liable for any damages

Sources/ObjectivelyGPU/CommandBuffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* ObjectivelyGPU: Object oriented MVC framework for SDL3 and GNU C.
2+
* ObjectivelyGPU: Object oriented graphics framework for SDL3 and GNU C.
33
* Copyright (C) 2026 Jay Dolan <jay@jaydolan.com>
44
*
55
* This software is provided 'as-is', without any express or implied

Sources/ObjectivelyGPU/CommandBuffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* ObjectivelyGPU: Object oriented MVC framework for SDL3 and GNU C.
2+
* ObjectivelyGPU: Object oriented graphics framework for SDL3 and GNU C.
33
* Copyright (C) 2026 Jay Dolan <jay@jaydolan.com>
44
*
55
* This software is provided 'as-is', without any express or implied

Sources/ObjectivelyGPU/ComputePass.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* ObjectivelyGPU: Object oriented MVC framework for SDL3 and GNU C.
2+
* ObjectivelyGPU: Object oriented graphics framework for SDL3 and GNU C.
33
* Copyright (C) 2026 Jay Dolan <jay@jaydolan.com>
44
*
55
* This software is provided 'as-is', without any express or implied

Sources/ObjectivelyGPU/ComputePass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* ObjectivelyGPU: Object oriented MVC framework for SDL3 and GNU C.
2+
* ObjectivelyGPU: Object oriented graphics framework for SDL3 and GNU C.
33
* Copyright (C) 2026 Jay Dolan <jay@jaydolan.com>
44
*
55
* This software is provided 'as-is', without any express or implied

Sources/ObjectivelyGPU/CopyPass.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* ObjectivelyGPU: Object oriented MVC framework for SDL3 and GNU C.
2+
* ObjectivelyGPU: Object oriented graphics framework for SDL3 and GNU C.
33
* Copyright (C) 2026 Jay Dolan <jay@jaydolan.com>
44
*
55
* This software is provided 'as-is', without any express or implied

Sources/ObjectivelyGPU/CopyPass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* ObjectivelyGPU: Object oriented MVC framework for SDL3 and GNU C.
2+
* ObjectivelyGPU: Object oriented graphics framework for SDL3 and GNU C.
33
* Copyright (C) 2026 Jay Dolan <jay@jaydolan.com>
44
*
55
* This software is provided 'as-is', without any express or implied

Sources/ObjectivelyGPU/Framebuffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* ObjectivelyGPU: Object oriented MVC framework for SDL3 and GNU C.
2+
* ObjectivelyGPU: Object oriented graphics framework for SDL3 and GNU C.
33
* Copyright (C) 2026 Jay Dolan <jay@jaydolan.com>
44
*
55
* This software is provided 'as-is', without any express or implied

Sources/ObjectivelyGPU/Framebuffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* ObjectivelyGPU: Object oriented MVC framework for SDL3 and GNU C.
2+
* ObjectivelyGPU: Object oriented graphics framework for SDL3 and GNU C.
33
* Copyright (C) 2026 Jay Dolan <jay@jaydolan.com>
44
*
55
* This software is provided 'as-is', without any express or implied

0 commit comments

Comments
 (0)