diff options
| author | lujinwangnv <143145775+lujinwangnv@users.noreply.github.com> | 2025-05-09 18:01:22 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-10 01:01:22 +0000 |
| commit | 5a6c2baadbc16fc2099a6951e389b9bd3cad08f6 (patch) | |
| tree | 1462aa33254eac9dbaee80fa1f6116b29db244e0 /tools | |
| parent | 029672ee08f5ecb710e84cf1ccc625e826ff9a29 (diff) | |
Update build to allow setting more external paths (#7044)
* Update build to allow setting more external paths
Update the build to allow setting user-specific paths for the external
modules: glm, imgui, slang-rhi, and tinyobjloader.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/CMakeLists.txt | 31 | ||||
| -rw-r--r-- | tools/gfx/vulkan/glslang-module.h | 2 | ||||
| -rw-r--r-- | tools/gfx/vulkan/vk-shader-program.cpp | 2 | ||||
| -rw-r--r-- | tools/platform/gui.h | 2 | ||||
| -rw-r--r-- | tools/platform/model.cpp | 8 | ||||
| -rw-r--r-- | tools/platform/vector-math.h | 8 |
6 files changed, 42 insertions, 11 deletions
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 53698726b..d871f91f2 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -164,6 +164,37 @@ if(SLANG_ENABLE_GFX) INCLUDE_DIRECTORIES_PUBLIC ${slang_SOURCE_DIR} ${slang_SOURCE_DIR}/include + if + (not ${SLANG_OVERRIDE_SPIRV_TOOLS_PATH}) + INCLUDE_DIRECTORIES_PUBLIC + ${slang_SOURCE_DIR}/external/spirv-tools + else + () + INCLUDE_DIRECTORIES_PUBLIC + ${SLANG_OVERRIDE_SPIRV_TOOLS_PATH} + endif + () + if + (not ${SLANG_OVERRIDE_GLM_PATH}) + INCLUDE_DIRECTORIES_PUBLIC ${slang_SOURCE_DIR}/external/glm else () + INCLUDE_DIRECTORIES_PUBLIC + ${SLANG_OVERRIDE_GLM_PATH} + endif + () + if + (not ${SLANG_OVERRIDE_IMGUI_PATH}) + INCLUDE_DIRECTORIES_PUBLIC ${slang_SOURCE_DIR}/external/imgui else () + INCLUDE_DIRECTORIES_PUBLIC + ${SLANG_OVERRIDE_IMGUI_PATH} + endif + () + if + (not ${SLANG_OVERRIDE_TINYOBJLOADER_PATH}) + INCLUDE_DIRECTORIES_PUBLIC + ${slang_SOURCE_DIR}/external/tinyobjloader + else + () + INCLUDE_DIRECTORIES_PUBLIC ${SLANG_OVERRIDE_TINYOBJLOADER_PATH} endif () INCLUDE_DIRECTORIES_PRIVATE ${NVAPI_INCLUDE_DIRS} INSTALL EXPORT_SET_NAME SlangTargets diff --git a/tools/gfx/vulkan/glslang-module.h b/tools/gfx/vulkan/glslang-module.h index cda903577..fc3e2861d 100644 --- a/tools/gfx/vulkan/glslang-module.h +++ b/tools/gfx/vulkan/glslang-module.h @@ -2,7 +2,7 @@ #pragma once #include "core/slang-list.h" -#include "external/spirv-tools/include/spirv-tools/linker.hpp" +#include "include/spirv-tools/linker.hpp" #include "slang-com-helper.h" #include "slang-com-ptr.h" #include "slang-glslang/slang-glslang.h" diff --git a/tools/gfx/vulkan/vk-shader-program.cpp b/tools/gfx/vulkan/vk-shader-program.cpp index 2dd9b0326..a7e754b6c 100644 --- a/tools/gfx/vulkan/vk-shader-program.cpp +++ b/tools/gfx/vulkan/vk-shader-program.cpp @@ -1,7 +1,7 @@ // vk-shader-program.cpp #include "vk-shader-program.h" -#include "external/spirv-tools/include/spirv-tools/linker.hpp" +#include "include/spirv-tools/linker.hpp" #include "vk-device.h" #include "vk-util.h" diff --git a/tools/platform/gui.h b/tools/platform/gui.h index eea9aa4f0..7e2a12ffe 100644 --- a/tools/platform/gui.h +++ b/tools/platform/gui.h @@ -2,7 +2,7 @@ #pragma once #include "core/slang-basic.h" -#include "external/imgui/imgui.h" +#include "imgui.h" #include "slang-com-ptr.h" #include "slang-gfx.h" #include "vector-math.h" diff --git a/tools/platform/model.cpp b/tools/platform/model.cpp index 18a7ad641..a0786d8da 100644 --- a/tools/platform/model.cpp +++ b/tools/platform/model.cpp @@ -4,15 +4,15 @@ #include "window.h" #define TINYOBJLOADER_IMPLEMENTATION -#include "../../external/tinyobjloader/tiny_obj_loader.h" +#include "tiny_obj_loader.h" #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" #define STB_IMAGE_RESIZE_IMPLEMENTATION -#include "../../external/glm/glm/glm.hpp" -#include "../../external/glm/glm/gtc/constants.hpp" -#include "../../external/glm/glm/gtc/matrix_transform.hpp" +#include "glm/glm.hpp" +#include "glm/gtc/constants.hpp" +#include "glm/gtc/matrix_transform.hpp" #include "stb_image_resize.h" #include <memory> diff --git a/tools/platform/vector-math.h b/tools/platform/vector-math.h index 2e24833eb..de84fe09f 100644 --- a/tools/platform/vector-math.h +++ b/tools/platform/vector-math.h @@ -3,10 +3,10 @@ // We will use the GLM library for our vector math types, just for simplicity. -#include "../../external/glm/glm/glm.hpp" -#include "../../external/glm/glm/gtc/constants.hpp" -#include "../../external/glm/glm/gtc/matrix_transform.hpp" -#include "../../external/glm/glm/gtc/quaternion.hpp" +#include "glm/glm.hpp" +#include "glm/gtc/constants.hpp" +#include "glm/gtc/matrix_transform.hpp" +#include "glm/gtc/quaternion.hpp" namespace gfx { |
