Skip to content

Commit

Permalink
cmake: don't give package managers a chance
Browse files Browse the repository at this point in the history
include paths for system and source tree targets are different, need to fix it first
  • Loading branch information
DHrpcs3 committed Sep 25, 2024
1 parent 9a9006f commit fe1e58a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 43 deletions.
56 changes: 24 additions & 32 deletions 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,32 @@ if(NOT xbyak_FOUND)
add_subdirectory(xbyak)
endif()

if(NOT SPIRV-Headers_FOUND)
add_subdirectory(SPIRV-Headers)
add_subdirectory(SPIRV-Headers)

add_subdirectory(SPIRV-Tools)

option(SPIRV_CROSS_SHARED "" on)
option(SPIRV_CROSS_STATIC "" on)
option(SPIRV_CROSS_ENABLE_GLSL "" on)
option(SPIRV_CROSS_ENABLE_HLSL "" off)
option(SPIRV_CROSS_ENABLE_MSL "" off)
option(SPIRV_CROSS_ENABLE_CPP "" off)
option(SPIRV_CROSS_ENABLE_REFLECT "" off)
option(SPIRV_CROSS_ENABLE_C_API "" off)
option(SPIRV_CROSS_ENABLE_UTIL "" off)
option(SPIRV_CROSS_CLI "" off)
option(SPIRV_CROSS_ENABLE_TESTS "" off)
option(SPIRV_CROSS_SKIP_INSTALL "" on)
add_subdirectory(SPIRV-Cross)

install(TARGETS spirv-cross-c-shared LIBRARY DESTINATION bin)
set_target_properties(spirv-cross-c-shared PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

add_subdirectory(glslang)
if(NOT TARGET glslang::glslang-standalone)
add_executable(glslang::glslang-standalone ALIAS glslang-standalone)
endif()

if(NOT SPIRV-Tools-opt_FOUND)
add_subdirectory(SPIRV-Tools)
endif()

if(NOT SPIRV-Cross_FOUND)
option(SPIRV_CROSS_SHARED "" on)
option(SPIRV_CROSS_STATIC "" on)
option(SPIRV_CROSS_ENABLE_GLSL "" on)
option(SPIRV_CROSS_ENABLE_HLSL "" off)
option(SPIRV_CROSS_ENABLE_MSL "" off)
option(SPIRV_CROSS_ENABLE_CPP "" off)
option(SPIRV_CROSS_ENABLE_REFLECT "" off)
option(SPIRV_CROSS_ENABLE_C_API "" off)
option(SPIRV_CROSS_ENABLE_UTIL "" off)
option(SPIRV_CROSS_CLI "" off)
option(SPIRV_CROSS_ENABLE_TESTS "" off)
option(SPIRV_CROSS_SKIP_INSTALL "" on)
add_subdirectory(SPIRV-Cross)

install(TARGETS spirv-cross-c-shared LIBRARY DESTINATION bin)
set_target_properties(spirv-cross-c-shared PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
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()
Expand Down
9 changes: 0 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@ set(CMAKE_BUILD_RPATH_USE_ORIGIN on)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

find_package(nlohmann_json CONFIG)
find_package(SPIRV-Cross 1.6 MODULE)
find_package(SPIRV-Tools-opt MODULE)
find_package(xbyak CONFIG)

if(SPIRV-Tools-opt_FOUND)
find_package(glslang CONFIG)
find_package(SPIRV-Headers CONFIG)
endif()

add_subdirectory(3rdparty EXCLUDE_FROM_ALL)

function(add_precompiled_vulkan_spirv target)
Expand Down
2 changes: 1 addition & 1 deletion rpcsx-gpu2/lib/gcn-shader/src/gcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "transform.hpp"
#include <glslang/Include/ResourceLimits.h>
#include <glslang/Public/ShaderLang.h>
#include <glslang/SPIRV/GlslangToSpv.h>
#include <SPIRV/GlslangToSpv.h>
#include <map>
#include <optional>
#include <print>
Expand Down
2 changes: 1 addition & 1 deletion rpcsx-gpu2/lib/gcn-shader/src/glsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <filesystem>
#include <fstream>
#include <glslang/Public/ShaderLang.h>
#include <spirv_cross_c.h>
#include <spirv_cross/spirv_cross_c.h>

static constexpr auto g_glslangLimit = 100;

Expand Down

0 comments on commit fe1e58a

Please sign in to comment.