-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
146 additions
and
33 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 |
---|---|---|
@@ -1,21 +1,40 @@ | ||
add_subdirectory(crypto) | ||
add_subdirectory(xbyak) | ||
add_subdirectory(SPIRV-Headers) | ||
add_subdirectory(SPIRV-Tools) | ||
|
||
set(SPIRV_CROSS_SHARED on) | ||
set(SPIRV_CROSS_STATIC on) | ||
set(SPIRV_CROSS_ENABLE_GLSL on) | ||
set(SPIRV_CROSS_ENABLE_HLSL off) | ||
set(SPIRV_CROSS_ENABLE_MSL off) | ||
set(SPIRV_CROSS_ENABLE_CPP off) | ||
set(SPIRV_CROSS_ENABLE_REFLECT off) | ||
set(SPIRV_CROSS_ENABLE_C_API off) | ||
set(SPIRV_CROSS_ENABLE_UTIL off) | ||
set(SPIRV_CROSS_CLI off) | ||
set(SPIRV_CROSS_ENABLE_TESTS off) | ||
set(SPIRV_CROSS_SKIP_INSTALL on) | ||
add_subdirectory(SPIRV-Cross) | ||
if(NOT xbyak_FOUND) | ||
add_subdirectory(xbyak) | ||
endif() | ||
|
||
add_subdirectory(glslang) | ||
add_subdirectory(json) | ||
if(NOT SPIRV-Headers_FOUND) | ||
add_subdirectory(SPIRV-Headers) | ||
endif() | ||
|
||
if(NOT SPIRV-Tools-opt_FOUND) | ||
add_subdirectory(SPIRV-Tools) | ||
endif() | ||
|
||
if(NOT SPIRV-Cross_FOUND) | ||
set(SPIRV_CROSS_SHARED on) | ||
set(SPIRV_CROSS_STATIC on) | ||
set(SPIRV_CROSS_ENABLE_GLSL on) | ||
set(SPIRV_CROSS_ENABLE_HLSL off) | ||
set(SPIRV_CROSS_ENABLE_MSL off) | ||
set(SPIRV_CROSS_ENABLE_CPP off) | ||
set(SPIRV_CROSS_ENABLE_REFLECT off) | ||
set(SPIRV_CROSS_ENABLE_C_API off) | ||
set(SPIRV_CROSS_ENABLE_UTIL off) | ||
set(SPIRV_CROSS_CLI off) | ||
set(SPIRV_CROSS_ENABLE_TESTS off) | ||
set(SPIRV_CROSS_SKIP_INSTALL on) | ||
add_subdirectory(SPIRV-Cross) | ||
endif() | ||
|
||
if(NOT glslang_FOUND) | ||
add_subdirectory(glslang) | ||
if(NOT TARGET glslang::glslang-standalone) | ||
add_executable(glslang::glslang-standalone ALIAS glslang-standalone) | ||
endif() | ||
endif() | ||
|
||
if(NOT nlohmann_json_FOUND) | ||
add_subdirectory(json) | ||
endif() |
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,51 @@ | ||
find_library(SPIRV-Cross_core_LIBRARY NAMES spirv-cross-core) | ||
find_library(SPIRV-Cross_glsl_LIBRARY NAMES spirv-cross-glsl) | ||
|
||
find_path(SPIRV-Cross_INCLUDE_DIR NAMES spirv.hpp PATH_SUFFIXES spirv_cross) | ||
if(SPIRV-Cross_INCLUDE_DIR) | ||
if(EXISTS "${SPIRV-Cross_INCLUDE_DIR}/spirv.hpp") | ||
file(STRINGS "${SPIRV-Cross_INCLUDE_DIR}/spirv.hpp" _ver_line | ||
REGEX "^[\t ]*#define[\t ]+SPV_VERSION[\t ]+0x[0-9]+" | ||
LIMIT_COUNT 1 | ||
) | ||
string(REGEX MATCH "0x[0-9]+" _ver "${_ver_line}") | ||
math(EXPR SPIRV-Cross_MAJOR_VERSION "${_ver} >> 16") | ||
math(EXPR SPIRV-Cross_MINOR_VERSION "${_ver} >> 8 & 0xFF") | ||
set(SPIRV-Cross_VERSION | ||
"${SPIRV-Cross_MAJOR_VERSION}.${SPIRV-Cross_MINOR_VERSION}" | ||
) | ||
unset(_ver_line) | ||
unset(_ver) | ||
endif() | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(SPIRV-Cross | ||
REQUIRED_VARS | ||
SPIRV-Cross_INCLUDE_DIR | ||
SPIRV-Cross_core_LIBRARY | ||
SPIRV-Cross_glsl_LIBRARY | ||
VERSION_VAR SPIRV-Cross_VERSION | ||
) | ||
|
||
if(SPIRV-Cross_FOUND AND NOT TARGET spirv-cross-core) | ||
add_library(spirv-cross-core UNKNOWN IMPORTED) | ||
set_target_properties(spirv-cross-core PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${SPIRV-Cross_INCLUDE_DIR}" | ||
IMPORTED_LOCATION "${SPIRV-Cross_core_LIBRARY}" | ||
) | ||
endif() | ||
|
||
if(SPIRV-Cross_FOUND AND NOT TARGET spirv-cross-glsl) | ||
add_library(spirv-cross-glsl UNKNOWN IMPORTED) | ||
set_target_properties(spirv-cross-glsl PROPERTIES | ||
IMPORTED_LOCATION "${SPIRV-Cross_glsl_LIBRARY}" | ||
) | ||
target_link_libraries(spirv-cross-glsl INTERFACE spirv-cross-core) | ||
endif() | ||
|
||
mark_as_advanced( | ||
SPIRV-Cross_INCLUDE_DIR | ||
SPIRV-Cross_core_LIBRARY | ||
SPIRV-Cross_glsl_LIBRARY | ||
) |
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,23 @@ | ||
find_package(PkgConfig QUIET) | ||
pkg_search_module(UNWIND QUIET IMPORTED_TARGET libunwind) | ||
|
||
find_library(libunwind_x86_64_LIBRARY | ||
NAMES unwind-x86_64 | ||
HINTS "${UNWIND_LIBRARY_DIRS}" | ||
) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(libunwind | ||
REQUIRED_VARS UNWIND_LINK_LIBRARIES libunwind_x86_64_LIBRARY | ||
VERSION_VAR UNWIND_VERSION | ||
) | ||
|
||
if(libunwind_FOUND AND NOT TARGET libunwind::unwind-x86_64) | ||
add_library(libunwind::unwind-x86_64 UNKNOWN IMPORTED) | ||
set_target_properties(libunwind::unwind-x86_64 PROPERTIES | ||
IMPORTED_LOCATION "${libunwind_x86_64_LIBRARY}" | ||
) | ||
target_link_libraries(libunwind::unwind-x86_64 INTERFACE PkgConfig::UNWIND) | ||
endif() | ||
|
||
mark_as_advanced(libunwind_x86_64_LIBRARY) |
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,12 @@ | ||
find_package(PkgConfig QUIET) | ||
pkg_search_module(SOX QUIET IMPORTED_TARGET sox) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(sox | ||
REQUIRED_VARS SOX_LINK_LIBRARIES | ||
VERSION_VAR SOX_VERSION | ||
) | ||
|
||
if(sox_FOUND AND NOT TARGET sox::sox) | ||
add_library(sox::sox ALIAS PkgConfig::SOX) | ||
endif() |
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
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
add_executable(spv-gen spv-gen.cpp) | ||
target_link_libraries(spv-gen PUBLIC nlohmann_json) | ||
target_link_libraries(spv-gen PUBLIC nlohmann_json::nlohmann_json) |