-
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.
Use vendored spirv-cross, added as git submodule
- Loading branch information
Showing
13 changed files
with
236 additions
and
4,031 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; | ||
} |
Oops, something went wrong.