From 2db15080085856ed9b5f20642dbb354aac59a888 Mon Sep 17 00:00:00 2001 From: kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> Date: Wed, 17 Jul 2024 12:53:19 -0500 Subject: Move the file public header files to `include` dir (#4636) * Move the file public header files to `include` dir Close the issue (#4635). Move the following headers files to a `include` dir located at root dir of slang repo: slang-com-helper.h -> include/slang-com-helper.h slang-com-ptr.h -> include/slang-com-ptr.h slang-gfx.h -> include/slang-gfx.h slang.h -> include/slang.h Change cmake/SlangTarget.cmake to add include path to every target, and change the source file to use "#include " to include the public headers. The source code update is by the script like follow: ``` fileNames_slang=$(grep -r "\".*slang\.h\"" source/ -l) for fileName in "${fileNames_slang[@]}" do echo "$fileName" sed -i "s/\".*slang\.h\"/\"slang\.h\"/" $fileName done ``` * Fix the test issues * Fix cpu test issues by adding include seach path * Update cmake to not add include path for every target Also change "#include " to "include "slang.h" " to make the coding style consistent with other slang code. * Change public include to private include for unit-test and slang-glslang --- source/compiler-core/slang-artifact-associated-impl.h | 4 ++-- source/compiler-core/slang-artifact-container-util.h | 4 ++-- source/compiler-core/slang-artifact-impl.h | 4 ++-- source/compiler-core/slang-artifact-representation-impl.h | 4 ++-- source/compiler-core/slang-artifact-util.h | 2 +- source/compiler-core/slang-artifact.h | 2 +- source/compiler-core/slang-core-diagnostics.h | 2 +- source/compiler-core/slang-diagnostic-sink.h | 2 +- source/compiler-core/slang-downstream-compiler-util.cpp | 2 +- source/compiler-core/slang-downstream-compiler.cpp | 2 +- source/compiler-core/slang-downstream-compiler.h | 2 +- source/compiler-core/slang-dxc-compiler.cpp | 2 +- source/compiler-core/slang-fxc-compiler.cpp | 2 +- source/compiler-core/slang-gcc-compiler-util.cpp | 4 ++-- source/compiler-core/slang-glslang-compiler.cpp | 2 +- source/compiler-core/slang-json-diagnostics.h | 2 +- source/compiler-core/slang-json-native.cpp | 2 +- source/compiler-core/slang-json-native.h | 6 +++--- source/compiler-core/slang-json-rpc.cpp | 2 +- source/compiler-core/slang-json-rpc.h | 6 +++--- source/compiler-core/slang-json-source-map-util.cpp | 2 +- source/compiler-core/slang-language-server-protocol.h | 6 +++--- source/compiler-core/slang-nvrtc-compiler.cpp | 2 +- source/compiler-core/slang-slice-allocator.h | 2 +- source/compiler-core/slang-source-embed-util.h | 2 +- source/compiler-core/slang-source-loc.h | 4 ++-- source/compiler-core/slang-source-map.h | 2 +- source/compiler-core/slang-test-server-protocol.h | 6 +++--- source/compiler-core/slang-visual-studio-compiler-util.cpp | 2 +- 29 files changed, 43 insertions(+), 43 deletions(-) (limited to 'source/compiler-core') diff --git a/source/compiler-core/slang-artifact-associated-impl.h b/source/compiler-core/slang-artifact-associated-impl.h index 8506f1628..5144fe7a7 100644 --- a/source/compiler-core/slang-artifact-associated-impl.h +++ b/source/compiler-core/slang-artifact-associated-impl.h @@ -2,8 +2,8 @@ #ifndef SLANG_ARTIFACT_ASSOCIATED_IMPL_H #define SLANG_ARTIFACT_ASSOCIATED_IMPL_H -#include "../../slang-com-helper.h" -#include "../../slang-com-ptr.h" +#include "slang-com-helper.h" +#include "slang-com-ptr.h" #include "../core/slang-com-object.h" #include "../core/slang-memory-arena.h" diff --git a/source/compiler-core/slang-artifact-container-util.h b/source/compiler-core/slang-artifact-container-util.h index 68c1f11f5..eb0a12dfc 100644 --- a/source/compiler-core/slang-artifact-container-util.h +++ b/source/compiler-core/slang-artifact-container-util.h @@ -4,8 +4,8 @@ #include "slang-artifact-representation.h" -#include "../../slang-com-helper.h" -#include "../../slang-com-ptr.h" +#include "slang-com-helper.h" +#include "slang-com-ptr.h" namespace Slang { diff --git a/source/compiler-core/slang-artifact-impl.h b/source/compiler-core/slang-artifact-impl.h index 4862142a8..22547d3ef 100644 --- a/source/compiler-core/slang-artifact-impl.h +++ b/source/compiler-core/slang-artifact-impl.h @@ -4,8 +4,8 @@ #include "slang-artifact.h" -#include "../../slang-com-helper.h" -#include "../../slang-com-ptr.h" +#include "slang-com-helper.h" +#include "slang-com-ptr.h" #include "../core/slang-com-object.h" diff --git a/source/compiler-core/slang-artifact-representation-impl.h b/source/compiler-core/slang-artifact-representation-impl.h index 5c76b9e7c..034084950 100644 --- a/source/compiler-core/slang-artifact-representation-impl.h +++ b/source/compiler-core/slang-artifact-representation-impl.h @@ -4,8 +4,8 @@ #include "slang-artifact-representation.h" -#include "../../slang-com-helper.h" -#include "../../slang-com-ptr.h" +#include "slang-com-helper.h" +#include "slang-com-ptr.h" #include "../core/slang-com-object.h" #include "../core/slang-memory-arena.h" diff --git a/source/compiler-core/slang-artifact-util.h b/source/compiler-core/slang-artifact-util.h index 792e6ff94..5341f309b 100644 --- a/source/compiler-core/slang-artifact-util.h +++ b/source/compiler-core/slang-artifact-util.h @@ -6,7 +6,7 @@ #include "slang-artifact-representation.h" #include "slang-artifact-associated.h" -#include "../../slang-com-ptr.h" +#include "slang-com-ptr.h" namespace Slang { diff --git a/source/compiler-core/slang-artifact.h b/source/compiler-core/slang-artifact.h index 4f33f5e2e..400c85b2e 100644 --- a/source/compiler-core/slang-artifact.h +++ b/source/compiler-core/slang-artifact.h @@ -3,7 +3,7 @@ #define SLANG_ARTIFACT_H #include "../core/slang-basic.h" -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include diff --git a/source/compiler-core/slang-core-diagnostics.h b/source/compiler-core/slang-core-diagnostics.h index 2d56591fd..fd1906fae 100644 --- a/source/compiler-core/slang-core-diagnostics.h +++ b/source/compiler-core/slang-core-diagnostics.h @@ -8,7 +8,7 @@ #include "slang-diagnostic-sink.h" #include "slang-token.h" -#include "../../slang.h" +#include "slang.h" namespace Slang { diff --git a/source/compiler-core/slang-diagnostic-sink.h b/source/compiler-core/slang-diagnostic-sink.h index 6e3c4ccb8..38a31752f 100644 --- a/source/compiler-core/slang-diagnostic-sink.h +++ b/source/compiler-core/slang-diagnostic-sink.h @@ -8,7 +8,7 @@ #include "slang-source-loc.h" #include "slang-token.h" -#include "../../slang.h" +#include "slang.h" namespace Slang { diff --git a/source/compiler-core/slang-downstream-compiler-util.cpp b/source/compiler-core/slang-downstream-compiler-util.cpp index 70ecb8ad7..70063b772 100644 --- a/source/compiler-core/slang-downstream-compiler-util.cpp +++ b/source/compiler-core/slang-downstream-compiler-util.cpp @@ -2,7 +2,7 @@ #include "slang-downstream-compiler-util.h" #include "../core/slang-common.h" -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "../core/slang-string-util.h" #include "../core/slang-type-text-util.h" diff --git a/source/compiler-core/slang-downstream-compiler.cpp b/source/compiler-core/slang-downstream-compiler.cpp index 88081ad84..855319176 100644 --- a/source/compiler-core/slang-downstream-compiler.cpp +++ b/source/compiler-core/slang-downstream-compiler.cpp @@ -2,7 +2,7 @@ #include "slang-downstream-compiler.h" #include "../core/slang-common.h" -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "../core/slang-string-util.h" #include "../core/slang-type-text-util.h" diff --git a/source/compiler-core/slang-downstream-compiler.h b/source/compiler-core/slang-downstream-compiler.h index c8cd02783..14e924f8b 100644 --- a/source/compiler-core/slang-downstream-compiler.h +++ b/source/compiler-core/slang-downstream-compiler.h @@ -11,7 +11,7 @@ #include "../core/slang-io.h" -#include "../../slang-com-ptr.h" +#include "slang-com-ptr.h" #include "slang-artifact.h" #include "slang-artifact-associated.h" diff --git a/source/compiler-core/slang-dxc-compiler.cpp b/source/compiler-core/slang-dxc-compiler.cpp index fc42dfc40..aa005d47f 100644 --- a/source/compiler-core/slang-dxc-compiler.cpp +++ b/source/compiler-core/slang-dxc-compiler.cpp @@ -2,7 +2,7 @@ #include "slang-dxc-compiler.h" #include "../core/slang-common.h" -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "../core/slang-blob.h" diff --git a/source/compiler-core/slang-fxc-compiler.cpp b/source/compiler-core/slang-fxc-compiler.cpp index ed92cc3f8..e4a9f25c7 100644 --- a/source/compiler-core/slang-fxc-compiler.cpp +++ b/source/compiler-core/slang-fxc-compiler.cpp @@ -4,7 +4,7 @@ #if SLANG_ENABLE_DXBC_SUPPORT #include "../core/slang-common.h" -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "../core/slang-blob.h" diff --git a/source/compiler-core/slang-gcc-compiler-util.cpp b/source/compiler-core/slang-gcc-compiler-util.cpp index 01f197875..875f7bea1 100644 --- a/source/compiler-core/slang-gcc-compiler-util.cpp +++ b/source/compiler-core/slang-gcc-compiler-util.cpp @@ -2,7 +2,7 @@ #include "slang-gcc-compiler-util.h" #include "../core/slang-common.h" -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "../core/slang-string-util.h" #include "../core/slang-io.h" @@ -210,7 +210,7 @@ static SlangResult _parseGCCFamilyLine(SliceAllocator& allocator, const UnownedS clang-7: error: linker command failed with exit code 1 (use -v to see invocation)*/ /* /path/slang-cpp-prelude.h:4:10: fatal error: ../slang.h: No such file or directory - #include "../slang.h" + #include "slang.h" ^~~~~~~~~~~~ compilation terminated.*/ diff --git a/source/compiler-core/slang-glslang-compiler.cpp b/source/compiler-core/slang-glslang-compiler.cpp index 0335c33b4..e0a537757 100644 --- a/source/compiler-core/slang-glslang-compiler.cpp +++ b/source/compiler-core/slang-glslang-compiler.cpp @@ -2,7 +2,7 @@ #include "slang-glslang-compiler.h" #include "../core/slang-common.h" -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "../core/slang-blob.h" diff --git a/source/compiler-core/slang-json-diagnostics.h b/source/compiler-core/slang-json-diagnostics.h index 88ec0c550..d819d8947 100644 --- a/source/compiler-core/slang-json-diagnostics.h +++ b/source/compiler-core/slang-json-diagnostics.h @@ -8,7 +8,7 @@ #include "slang-diagnostic-sink.h" #include "slang-token.h" -#include "../../slang.h" +#include "slang.h" namespace Slang { diff --git a/source/compiler-core/slang-json-native.cpp b/source/compiler-core/slang-json-native.cpp index 8b0ec1194..eb0f7d9ee 100644 --- a/source/compiler-core/slang-json-native.cpp +++ b/source/compiler-core/slang-json-native.cpp @@ -1,6 +1,6 @@ #include "slang-json-native.h" -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "../core/slang-rtti-util.h" diff --git a/source/compiler-core/slang-json-native.h b/source/compiler-core/slang-json-native.h index 72e339621..6920d59e9 100644 --- a/source/compiler-core/slang-json-native.h +++ b/source/compiler-core/slang-json-native.h @@ -1,9 +1,9 @@ #ifndef SLANG_COMPILER_CORE_JSON_NATIVE_H #define SLANG_COMPILER_CORE_JSON_NATIVE_H -#include "../../slang.h" -#include "../../slang-com-helper.h" -#include "../../slang-com-ptr.h" +#include "slang.h" +#include "slang-com-helper.h" +#include "slang-com-ptr.h" #include "slang-json-value.h" diff --git a/source/compiler-core/slang-json-rpc.cpp b/source/compiler-core/slang-json-rpc.cpp index 3474718c7..f4a61da1e 100644 --- a/source/compiler-core/slang-json-rpc.cpp +++ b/source/compiler-core/slang-json-rpc.cpp @@ -1,6 +1,6 @@ #include "slang-json-rpc.h" -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "slang-json-native.h" diff --git a/source/compiler-core/slang-json-rpc.h b/source/compiler-core/slang-json-rpc.h index f32513b02..6baba7829 100644 --- a/source/compiler-core/slang-json-rpc.h +++ b/source/compiler-core/slang-json-rpc.h @@ -1,9 +1,9 @@ #ifndef SLANG_COMPILER_CORE_JSON_RPC_H #define SLANG_COMPILER_CORE_JSON_RPC_H -#include "../../slang.h" -#include "../../slang-com-helper.h" -#include "../../slang-com-ptr.h" +#include "slang.h" +#include "slang-com-helper.h" +#include "slang-com-ptr.h" #include "slang-json-value.h" diff --git a/source/compiler-core/slang-json-source-map-util.cpp b/source/compiler-core/slang-json-source-map-util.cpp index 30d722c4c..f66ee50da 100644 --- a/source/compiler-core/slang-json-source-map-util.cpp +++ b/source/compiler-core/slang-json-source-map-util.cpp @@ -1,6 +1,6 @@ #include "slang-json-source-map-util.h" -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "../core/slang-string-util.h" #include "../core/slang-blob.h" diff --git a/source/compiler-core/slang-language-server-protocol.h b/source/compiler-core/slang-language-server-protocol.h index 3dcc90be1..ff5cd394e 100644 --- a/source/compiler-core/slang-language-server-protocol.h +++ b/source/compiler-core/slang-language-server-protocol.h @@ -1,8 +1,8 @@ #pragma once -#include "../../slang-com-helper.h" -#include "../../slang-com-ptr.h" -#include "../../slang.h" +#include "slang-com-helper.h" +#include "slang-com-ptr.h" +#include "slang.h" #include "../../source/core/slang-rtti-info.h" #include "../../source/compiler-core/slang-json-value.h" diff --git a/source/compiler-core/slang-nvrtc-compiler.cpp b/source/compiler-core/slang-nvrtc-compiler.cpp index b84b1a403..80fde277b 100644 --- a/source/compiler-core/slang-nvrtc-compiler.cpp +++ b/source/compiler-core/slang-nvrtc-compiler.cpp @@ -2,7 +2,7 @@ #include "slang-nvrtc-compiler.h" #include "../core/slang-common.h" -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "../core/slang-blob.h" diff --git a/source/compiler-core/slang-slice-allocator.h b/source/compiler-core/slang-slice-allocator.h index a6f0cd5c1..8d61fa211 100644 --- a/source/compiler-core/slang-slice-allocator.h +++ b/source/compiler-core/slang-slice-allocator.h @@ -4,7 +4,7 @@ // Has definition of CharSlice #include "slang-artifact.h" -#include "../../slang-com-ptr.h" +#include "slang-com-ptr.h" #include "../core/slang-memory-arena.h" diff --git a/source/compiler-core/slang-source-embed-util.h b/source/compiler-core/slang-source-embed-util.h index 70389cfe1..52115e4ef 100644 --- a/source/compiler-core/slang-source-embed-util.h +++ b/source/compiler-core/slang-source-embed-util.h @@ -6,7 +6,7 @@ #include "slang-artifact.h" #include "slang-diagnostic-sink.h" -#include "../../slang-com-ptr.h" +#include "slang-com-ptr.h" #include "../core/slang-name-value.h" diff --git a/source/compiler-core/slang-source-loc.h b/source/compiler-core/slang-source-loc.h index 0a94980d1..bf0be47f6 100644 --- a/source/compiler-core/slang-source-loc.h +++ b/source/compiler-core/slang-source-loc.h @@ -10,8 +10,8 @@ #include "slang-source-map.h" -#include "../../slang-com-ptr.h" -#include "../../slang.h" +#include "slang-com-ptr.h" +#include "slang.h" namespace Slang { diff --git a/source/compiler-core/slang-source-map.h b/source/compiler-core/slang-source-map.h index 0c55d3a1a..4060fadb8 100644 --- a/source/compiler-core/slang-source-map.h +++ b/source/compiler-core/slang-source-map.h @@ -1,7 +1,7 @@ #ifndef SLANG_COMPILER_CORE_SOURCE_MAP_H #define SLANG_COMPILER_CORE_SOURCE_MAP_H -#include "../../slang.h" +#include "slang.h" #include "../core/slang-string.h" #include "../core/slang-list.h" diff --git a/source/compiler-core/slang-test-server-protocol.h b/source/compiler-core/slang-test-server-protocol.h index 8b61c4b39..b74a1a872 100644 --- a/source/compiler-core/slang-test-server-protocol.h +++ b/source/compiler-core/slang-test-server-protocol.h @@ -1,9 +1,9 @@ #ifndef SLANG_COMPILER_CORE_TEST_PROTOCOL_H #define SLANG_COMPILER_CORE_TEST_PROTOCOL_H -#include "../../slang.h" -#include "../../slang-com-helper.h" -#include "../../slang-com-ptr.h" +#include "slang.h" +#include "slang-com-helper.h" +#include "slang-com-ptr.h" #include "../core/slang-rtti-info.h" #include "slang-json-value.h" diff --git a/source/compiler-core/slang-visual-studio-compiler-util.cpp b/source/compiler-core/slang-visual-studio-compiler-util.cpp index 753d256a6..df3285608 100644 --- a/source/compiler-core/slang-visual-studio-compiler-util.cpp +++ b/source/compiler-core/slang-visual-studio-compiler-util.cpp @@ -2,7 +2,7 @@ #include "slang-visual-studio-compiler-util.h" #include "../core/slang-common.h" -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "../core/slang-string-util.h" #include "../core/slang-string-slice-pool.h" -- cgit v1.2.3