diff options
| author | Lujin Wang <143145775+lujinwangnv@users.noreply.github.com> | 2025-05-30 12:52:55 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-30 19:52:55 +0000 |
| commit | b16eb592cc31b7cc9ba3d2f9525486c282996a9e (patch) | |
| tree | b7916c5dbbb27ffbe330a783ed1dcc0fd9bc4b3b | |
| parent | ec7ab914f79978b8980c7797e20d3399604b1f86 (diff) | |
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 <yonghe@outlook.com>
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
| -rw-r--r-- | external/CMakeLists.txt | 20 | ||||
| -rw-r--r-- | source/slang/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | tools/CMakeLists.txt | 16 | ||||
| -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 | ||||
| -rw-r--r-- | tools/slang-fiddle/slang-fiddle-lua.cpp | 2 | ||||
| -rw-r--r-- | tools/slang-fiddle/slang-fiddle-script.cpp | 6 | ||||
| -rw-r--r-- | tools/slang-fiddle/slang-fiddle-script.h | 4 |
11 files changed, 33 insertions, 39 deletions
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index cabccd260..9253d3e2d 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -31,7 +31,7 @@ if(NOT ${SLANG_USE_SYSTEM_UNORDERED_DENSE}) add_subdirectory(unordered_dense EXCLUDE_FROM_ALL ${system}) else() add_subdirectory( - ${SLANG_OVERRIDE_UNORDERED_DENSE_PATH} + ${SLANG_OVERRIDE_UNORDERED_DENSE_PATH}/unordered_dense unordered_dense EXCLUDE_FROM_ALL ${system} @@ -45,7 +45,7 @@ if(NOT ${SLANG_USE_SYSTEM_MINIZ}) add_subdirectory(miniz EXCLUDE_FROM_ALL ${system}) else() add_subdirectory( - ${SLANG_OVERRIDE_MINIZ_PATH} + ${SLANG_OVERRIDE_MINIZ_PATH}/miniz miniz EXCLUDE_FROM_ALL ${system} @@ -67,7 +67,7 @@ if(NOT ${SLANG_USE_SYSTEM_LZ4}) add_subdirectory(lz4/build/cmake EXCLUDE_FROM_ALL ${system}) else() add_subdirectory( - ${SLANG_OVERRIDE_LZ4_PATH}/build/cmake + ${SLANG_OVERRIDE_LZ4_PATH}/lz4/build/cmake lz4/build/cmake EXCLUDE_FROM_ALL ${system} @@ -87,7 +87,7 @@ if(NOT ${SLANG_USE_SYSTEM_VULKAN_HEADERS}) add_subdirectory(vulkan EXCLUDE_FROM_ALL ${system}) else() add_subdirectory( - ${SLANG_OVERRIDE_VULKAN_HEADERS_PATH} + ${SLANG_OVERRIDE_VULKAN_HEADERS_PATH}/vulkan vulkan EXCLUDE_FROM_ALL ${system} @@ -108,7 +108,7 @@ if(NOT ${SLANG_USE_SYSTEM_SPIRV_HEADERS}) add_subdirectory(spirv-headers EXCLUDE_FROM_ALL ${system}) else() add_subdirectory( - ${SLANG_OVERRIDE_SPIRV_HEADERS_PATH} + ${SLANG_OVERRIDE_SPIRV_HEADERS_PATH}/spirv-headers spirv-headers EXCLUDE_FROM_ALL ${system} @@ -124,7 +124,7 @@ if(SLANG_ENABLE_SLANG_GLSLANG) if(NOT SLANG_OVERRIDE_SPIRV_HEADERS_PATH) set(SPIRV_HEADER_DIR "${CMAKE_CURRENT_LIST_DIR}/spirv-headers/") else() - set(SPIRV_HEADER_DIR ${SLANG_OVERRIDE_SPIRV_HEADERS_PATH}) + set(SPIRV_HEADER_DIR ${SLANG_OVERRIDE_SPIRV_HEADERS_PATH}/spirv-headers) endif() set(SPIRV_SKIP_TESTS ON) # Tools @@ -132,7 +132,7 @@ if(SLANG_ENABLE_SLANG_GLSLANG) add_subdirectory(spirv-tools EXCLUDE_FROM_ALL ${system}) else() add_subdirectory( - ${SLANG_OVERRIDE_SPIRV_TOOLS_PATH} + ${SLANG_OVERRIDE_SPIRV_TOOLS_PATH}/spirv-tools spirv-tools EXCLUDE_FROM_ALL ${system} @@ -147,7 +147,7 @@ if(SLANG_ENABLE_SLANG_GLSLANG) add_subdirectory(glslang EXCLUDE_FROM_ALL ${system}) else() add_subdirectory( - ${SLANG_OVERRIDE_GLSLANG_PATH} + ${SLANG_OVERRIDE_GLSLANG_PATH}/glslang glslang EXCLUDE_FROM_ALL ${system} @@ -167,7 +167,7 @@ else() target_include_directories( imgui ${system} - INTERFACE "${SLANG_OVERRIDE_IMGUI_PATH}" + INTERFACE "${SLANG_OVERRIDE_IMGUI_PATH}/imgui" ) endif() @@ -204,7 +204,7 @@ if(SLANG_ENABLE_SLANG_RHI) add_subdirectory(slang-rhi) else() add_subdirectory( - ${SLANG_OVERRIDE_SLANG_RHI_PATH} + ${SLANG_OVERRIDE_SLANG_RHI_PATH}/slang-rhi slang-rhi EXCLUDE_FROM_ALL ${system} diff --git a/source/slang/CMakeLists.txt b/source/slang/CMakeLists.txt index daea0e002..9ebf6b2bd 100644 --- a/source/slang/CMakeLists.txt +++ b/source/slang/CMakeLists.txt @@ -107,7 +107,7 @@ if(NOT SLANG_USE_SYSTEM_SPIRV_HEADERS) ) else() set(SLANG_SPIRV_HEADERS_INCLUDE_DIR - "${SLANG_OVERRIDE_SPIRV_HEADERS_PATH}/include" + "${SLANG_OVERRIDE_SPIRV_HEADERS_PATH}/spirv-headers/include" ) endif() endif() 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 <memory> 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" |
