-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Link SPIRV-Cross instead of using SDL_LoadObject (#46)
--------- Co-authored-by: Anonymous Maarten <[email protected]>
- Loading branch information
1 parent
1d60b24
commit 3385fb5
Showing
15 changed files
with
355 additions
and
4,289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "spirv-cross"] | ||
path = external/SPIRV-Cross | ||
url = https://github.com/KhronosGroup/SPIRV-Cross.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# This cmake build script is meant for verifying the various CMake configuration script. | ||
|
||
cmake_minimum_required(VERSION 3.12) | ||
project(sdl_test LANGUAGES C) | ||
|
||
cmake_policy(SET CMP0074 NEW) | ||
|
||
# Override CMAKE_FIND_ROOT_PATH_MODE to allow search for SDL3 outside of sysroot | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER) | ||
|
||
include(FeatureSummary) | ||
|
||
option(TEST_SHARED "Test linking to shared SDL3_gpu_shadercross library" ON) | ||
add_feature_info("TEST_SHARED" TEST_SHARED "Test linking with shared library") | ||
|
||
option(TEST_STATIC "Test linking to static SDL3_gpu_shadercross library" ON) | ||
add_feature_info("TEST_STATIC" TEST_STATIC "Test linking with static library") | ||
|
||
if(ANDROID) | ||
macro(add_executable NAME) | ||
set(args ${ARGN}) | ||
list(REMOVE_ITEM args WIN32) | ||
add_library(${NAME} SHARED ${args}) | ||
unset(args) | ||
endmacro() | ||
endif() | ||
|
||
if(TEST_SHARED) | ||
find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3) | ||
find_package(SDL3_gpu_shadercross REQUIRED CONFIG) | ||
add_executable(main_shared main.c) | ||
target_link_libraries(main_shared PRIVATE SDL3_gpu_shadercross::SDL3_gpu_shadercross-shared SDL3::SDL3) | ||
endif() | ||
|
||
if(TEST_STATIC) | ||
find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3) | ||
# some static vendored libraries use c++ (enable CXX after `find_package` might show a warning) | ||
enable_language(CXX) | ||
find_package(SDL3_gpu_shadercross REQUIRED CONFIG) | ||
add_executable(main_static main.c) | ||
target_link_libraries(main_static PRIVATE SDL3_gpu_shadercross::SDL3_gpu_shadercross-static SDL3::SDL3) | ||
endif() | ||
|
||
feature_summary(WHAT ALL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <SDL3/SDL.h> | ||
#include <SDL3_gpu_shadercross/SDL_gpu_shadercross.h> | ||
|
||
int main(int argc, char *argv[]) { | ||
if (!SDL_Init(0)) { | ||
SDL_Log("SDL_Init failed (%s)", SDL_GetError()); | ||
return 1; | ||
} | ||
if (!SDL_ShaderCross_Init()) { | ||
SDL_Log("SDL_ShaderCross_Init failed (%s)", SDL_GetError()); | ||
return 1; | ||
} | ||
SDL_ShaderCross_Quit(); | ||
SDL_Quit(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<# | ||
.SYNOPSIS | ||
Downloads the Git modules specified in ../.gitmodules | ||
.DESCRIPTION | ||
Parses and downloads the Github repositories specified in the .gitmodules file | ||
.EXAMPLE | ||
PS> .\Get-GitModules.ps1 | ||
< Downloads and parses the repositories in the .gitmodules file. > | ||
#> | ||
|
||
#------- Variables ------------------------------------------------------------- | ||
[String] $PathRegex = "path\s*=\s*(?<path>.*)" | ||
[String] $URLRegex = "url\s*=\s*(?<url>.*)" | ||
[String] $BranchRegex = "branch\s*=\s*(?<Branch>.*)" | ||
|
||
#------- Script ---------------------------------------------------------------- | ||
foreach ($Line in Get-Content $PSScriptRoot\..\.gitmodules) { | ||
if ($Line -match $PathRegex) { | ||
$Match = Select-String -InputObject $Line -Pattern $PathRegex | ||
$Path = $Match.Matches[0].Groups[1].Value | ||
} | ||
elseif ($Line -match $URLRegex) { | ||
$Match = Select-String -InputObject $Line -Pattern $URLRegex | ||
$URL = $Match.Matches[0].Groups[1].Value | ||
} | ||
elseif ($Line -match $BranchRegex) { | ||
$Match = Select-String -InputObject $Line -Pattern $BranchRegex | ||
$Branch = $Match.Matches[0].Groups[1].Value | ||
|
||
Write-Host "git clone --filter=blob:none $URL $Path -b $Branch --recursive" ` | ||
-ForegroundColor Blue | ||
git clone --filter=blob:none $URL $PSScriptRoot/../$Path -b $Branch --recursive | ||
} | ||
} |
Submodule SPIRV-Cross
added at
d1d4ad
Oops, something went wrong.