From b16eb592cc31b7cc9ba3d2f9525486c282996a9e Mon Sep 17 00:00:00 2001 From: Lujin Wang <143145775+lujinwangnv@users.noreply.github.com> Date: Fri, 30 May 2025 12:52:55 -0700 Subject: Change SLANG_OVERRIDE_xxx_PATH and fix header file path (#7207) * Fix lua header file path Add two missed files in #7167 * Fix lua header file path Add two missed files in #7167 * Leave lua/ in the path to avoid name conflict * Remove xxx from path of SLANG_OVERRIDE_xxx_PATH Change SLANG_OVERRIDE_xxx_PATH from path-to-parent-folder/xxx to path-to-parent-folder and add "xxx/" back to "#include", which helps to avoid the potential name conflict of external tools. * format code --------- Co-authored-by: Yong He Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --- tools/CMakeLists.txt | 16 +++++----------- tools/gfx/vulkan/glslang-module.h | 2 +- tools/gfx/vulkan/vk-shader-program.cpp | 2 +- tools/platform/gui.h | 2 +- tools/platform/model.cpp | 8 ++++---- tools/platform/vector-math.h | 8 ++++---- tools/slang-fiddle/slang-fiddle-lua.cpp | 2 +- tools/slang-fiddle/slang-fiddle-script.cpp | 6 +++--- tools/slang-fiddle/slang-fiddle-script.h | 4 ++-- 9 files changed, 22 insertions(+), 28 deletions(-) (limited to 'tools') diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index aad87e21d..6ca35b8b0 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -51,7 +51,7 @@ if(NOT SLANG_OVERRIDE_LUA_PATH) LINK_WITH_PRIVATE compiler-core INCLUDE_DIRECTORIES_PUBLIC - ${slang_SOURCE_DIR}/external/lua + ${slang_SOURCE_DIR}/external ) else() generator( @@ -182,34 +182,28 @@ if(SLANG_ENABLE_GFX) ${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_SOURCE_DIR}/external 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_SOURCE_DIR}/external 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_SOURCE_DIR}/external 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_SOURCE_DIR}/external else () INCLUDE_DIRECTORIES_PUBLIC ${SLANG_OVERRIDE_TINYOBJLOADER_PATH} endif () INCLUDE_DIRECTORIES_PRIVATE ${NVAPI_INCLUDE_DIRS} INSTALL diff --git a/tools/gfx/vulkan/glslang-module.h b/tools/gfx/vulkan/glslang-module.h index fc3e2861d..16fca5ce9 100644 --- a/tools/gfx/vulkan/glslang-module.h +++ b/tools/gfx/vulkan/glslang-module.h @@ -2,11 +2,11 @@ #pragma once #include "core/slang-list.h" -#include "include/spirv-tools/linker.hpp" #include "slang-com-helper.h" #include "slang-com-ptr.h" #include "slang-glslang/slang-glslang.h" #include "slang.h" +#include "spirv-tools/include/spirv-tools/linker.hpp" namespace gfx { diff --git a/tools/gfx/vulkan/vk-shader-program.cpp b/tools/gfx/vulkan/vk-shader-program.cpp index a7e754b6c..dbe2cbb82 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 "include/spirv-tools/linker.hpp" +#include "spirv-tools/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 7e2a12ffe..121fc0894 100644 --- a/tools/platform/gui.h +++ b/tools/platform/gui.h @@ -2,7 +2,7 @@ #pragma once #include "core/slang-basic.h" -#include "imgui.h" +#include "imgui/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 a0786d8da..8453363c3 100644 --- a/tools/platform/model.cpp +++ b/tools/platform/model.cpp @@ -4,15 +4,15 @@ #include "window.h" #define TINYOBJLOADER_IMPLEMENTATION -#include "tiny_obj_loader.h" +#include "tinyobjloader/tiny_obj_loader.h" #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" #define STB_IMAGE_RESIZE_IMPLEMENTATION -#include "glm/glm.hpp" -#include "glm/gtc/constants.hpp" -#include "glm/gtc/matrix_transform.hpp" +#include "glm/glm/glm.hpp" +#include "glm/glm/gtc/constants.hpp" +#include "glm/glm/gtc/matrix_transform.hpp" #include "stb_image_resize.h" #include diff --git a/tools/platform/vector-math.h b/tools/platform/vector-math.h index de84fe09f..9614f6286 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 "glm/glm.hpp" -#include "glm/gtc/constants.hpp" -#include "glm/gtc/matrix_transform.hpp" -#include "glm/gtc/quaternion.hpp" +#include "glm/glm/glm.hpp" +#include "glm/glm/gtc/constants.hpp" +#include "glm/glm/gtc/matrix_transform.hpp" +#include "glm/glm/gtc/quaternion.hpp" namespace gfx { diff --git a/tools/slang-fiddle/slang-fiddle-lua.cpp b/tools/slang-fiddle/slang-fiddle-lua.cpp index 0d5f04eca..adebf555c 100644 --- a/tools/slang-fiddle/slang-fiddle-lua.cpp +++ b/tools/slang-fiddle/slang-fiddle-lua.cpp @@ -2,4 +2,4 @@ #define MAKE_LIB 1 -#include "onelua.c" +#include "lua/onelua.c" diff --git a/tools/slang-fiddle/slang-fiddle-script.cpp b/tools/slang-fiddle/slang-fiddle-script.cpp index 5add4e16e..0bee052d8 100644 --- a/tools/slang-fiddle/slang-fiddle-script.cpp +++ b/tools/slang-fiddle/slang-fiddle-script.cpp @@ -1,9 +1,9 @@ // slang-fiddle-script.cpp #include "slang-fiddle-script.h" -#include "../external/lua/lapi.h" -#include "../external/lua/lauxlib.h" -#include "../external/lua/lualib.h" +#include "lua/lapi.h" +#include "lua/lauxlib.h" +#include "lua/lualib.h" namespace fiddle { diff --git a/tools/slang-fiddle/slang-fiddle-script.h b/tools/slang-fiddle/slang-fiddle-script.h index d8221a2e8..4b77b32be 100644 --- a/tools/slang-fiddle/slang-fiddle-script.h +++ b/tools/slang-fiddle/slang-fiddle-script.h @@ -1,11 +1,11 @@ // slang-fiddle-script.h #pragma once -#include "../external/lua/lapi.h" -#include "../external/lua/lauxlib.h" #include "compiler-core/slang-source-loc.h" #include "core/slang-list.h" #include "core/slang-string.h" +#include "lua/lapi.h" +#include "lua/lauxlib.h" #include "slang-fiddle-diagnostics.h" #include "slang-fiddle-scrape.h" -- cgit v1.2.3