Skip to content

Commit

Permalink
Fix json-c dependency in shady
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Frisch <[email protected]>
  • Loading branch information
TheJackiMonster committed Jan 13, 2024
1 parent e5e52ba commit 236d426
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,6 @@
[submodule "modules/shader_compiler/lib/murmur3"]
path = modules/shader_compiler/lib/murmur3
url = https://github.com/PeterScott/murmur3.git
[submodule "modules/shader_compiler/lib/json-c"]
path = modules/shader_compiler/lib/json-c
url = https://github.com/json-c/json-c.git
3 changes: 2 additions & 1 deletion modules/shader_compiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ set_target_properties(vkcv_shader_compiler PROPERTIES PUBLIC_HEADER "${vkcv_shad
set(vkcv_shader_compiler_lib lib)
set(vkcv_shader_compiler_lib_path ${PROJECT_SOURCE_DIR}/${vkcv_shader_compiler_lib})

# Load SPIRV-Headers
# Load JSON-C and SPIRV-Headers
include(config/JSON-C.cmake)
include(config/SPIRV-Headers.cmake)

# Check and load GLSLANG
Expand Down
9 changes: 9 additions & 0 deletions modules/shader_compiler/config/JSON-C.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

use_git_submodule("${vkcv_shader_compiler_lib_path}/json-c" json_c_status)

if (${json_c_status})
add_subdirectory(${vkcv_shader_compiler_lib}/json-c)

list(APPEND vkcv_shader_compiler_libraries json-c)
list(APPEND vkcv_shader_compiler_includes ${vkcv_shader_compiler_lib})
endif ()
1 change: 1 addition & 0 deletions modules/shader_compiler/config/Shady.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
use_git_submodule("${vkcv_shader_compiler_lib_path}/shady" shady_status)

if (${shady_status})
set(EXTERNAL_JSON_C ON CACHE INTERNAL "")
set(EXTERNAL_SPIRV_HEADERS ON CACHE INTERNAL "")
set(EXTERNAL_MURMUR3 ON CACHE INTERNAL "")

Expand Down
1 change: 1 addition & 0 deletions modules/shader_compiler/lib/json-c
Submodule json-c added at dabed8
2 changes: 1 addition & 1 deletion modules/shader_compiler/lib/shady

0 comments on commit 236d426

Please sign in to comment.