diff options
| author | kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> | 2024-07-17 12:53:19 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-17 10:53:19 -0700 |
| commit | 2db15080085856ed9b5f20642dbb354aac59a888 (patch) | |
| tree | 4f6558b8c3aac5e5191edaa092230ecb449f4a44 /tools | |
| parent | 7d07bd29fee7dcd74fe73940723effc68f427e67 (diff) | |
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 <slang.h>" 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 <slang.h>" 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
Diffstat (limited to 'tools')
24 files changed, 48 insertions, 35 deletions
diff --git a/tools/gfx-unit-test/gfx-test-texture-util.cpp b/tools/gfx-unit-test/gfx-test-texture-util.cpp index 3b3a1a760..21e82ab22 100644 --- a/tools/gfx-unit-test/gfx-test-texture-util.cpp +++ b/tools/gfx-unit-test/gfx-test-texture-util.cpp @@ -2,7 +2,7 @@ #include "gfx-test-util.h" #include "tools/unit-test/slang-unit-test.h" -#include <slang-com-ptr.h> +#include "slang-com-ptr.h" #include <stdlib.h> #include <stdio.h> diff --git a/tools/gfx-unit-test/gfx-test-util.cpp b/tools/gfx-unit-test/gfx-test-util.cpp index fe06a1745..3ca67e67b 100644 --- a/tools/gfx-unit-test/gfx-test-util.cpp +++ b/tools/gfx-unit-test/gfx-test-util.cpp @@ -1,7 +1,7 @@ #include "gfx-test-util.h" #include "tools/unit-test/slang-unit-test.h" -#include <slang-com-ptr.h> +#include "slang-com-ptr.h" #define GFX_ENABLE_RENDERDOC_INTEGRATION 0 #define GFX_ENABLE_SPIRV_DEBUG 0 diff --git a/tools/gfx/renderer-shared.cpp b/tools/gfx/renderer-shared.cpp index d4fda3183..65a14c8cb 100644 --- a/tools/gfx/renderer-shared.cpp +++ b/tools/gfx/renderer-shared.cpp @@ -6,7 +6,7 @@ #include "../../source/core/slang-stable-hash.h" #include "../../source/core/slang-file-system.h" -#include "../../slang.h" +#include "slang.h" using namespace Slang; diff --git a/tools/render-test/diagnostics.h b/tools/render-test/diagnostics.h index 08ba28e27..fa4c8a389 100644 --- a/tools/render-test/diagnostics.h +++ b/tools/render-test/diagnostics.h @@ -7,7 +7,7 @@ #include "../../source/compiler-core/slang-source-loc.h" #include "../../source/compiler-core/slang-diagnostic-sink.h" -#include "../../slang.h" +#include "slang.h" namespace Slang { diff --git a/tools/render-test/options.h b/tools/render-test/options.h index 6ea166833..1400f0129 100644 --- a/tools/render-test/options.h +++ b/tools/render-test/options.h @@ -7,14 +7,14 @@ #define SLANG_HANDLE_RESULT_FAIL(x) assert(!"failure") #endif -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "../../source/core/slang-writer.h" #include "../../source/core/slang-process-util.h" #include "../../source/compiler-core/slang-command-line-args.h" -#include "../../slang-gfx.h" +#include "slang-gfx.h" namespace renderer_test { diff --git a/tools/render-test/slang-support.h b/tools/render-test/slang-support.h index 6eef93edc..0ed6216a9 100644 --- a/tools/render-test/slang-support.h +++ b/tools/render-test/slang-support.h @@ -3,7 +3,7 @@ #include "slang-gfx.h" -#include <slang.h> +#include "slang.h" #include "shader-input-layout.h" #include "options.h" diff --git a/tools/slang-cpp-extractor/cpp-extractor-main.cpp b/tools/slang-cpp-extractor/cpp-extractor-main.cpp index 2bc0596e1..e3bb041be 100644 --- a/tools/slang-cpp-extractor/cpp-extractor-main.cpp +++ b/tools/slang-cpp-extractor/cpp-extractor-main.cpp @@ -5,7 +5,7 @@ #include <string.h> #include "../../source/core/slang-secure-crt.h" -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "../../source/core/slang-list.h" #include "../../source/core/slang-string.h" diff --git a/tools/slang-cpp-extractor/macro-writer.cpp b/tools/slang-cpp-extractor/macro-writer.cpp index 24d95850a..285a91851 100644 --- a/tools/slang-cpp-extractor/macro-writer.cpp +++ b/tools/slang-cpp-extractor/macro-writer.cpp @@ -1,6 +1,6 @@ #include "macro-writer.h" -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "../../source/core/slang-list.h" #include "../../source/core/slang-string.h" diff --git a/tools/slang-profile/slang-profile-main.cpp b/tools/slang-profile/slang-profile-main.cpp index 7cf6cb6f8..d23a7ba10 100644 --- a/tools/slang-profile/slang-profile-main.cpp +++ b/tools/slang-profile/slang-profile-main.cpp @@ -5,7 +5,7 @@ #include "../../source/core/slang-process-util.h" -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "../../source/core/slang-string-util.h" diff --git a/tools/slang-reflection-test/slang-reflection-test-main.cpp b/tools/slang-reflection-test/slang-reflection-test-main.cpp index 4b5faae6b..be48d8e92 100644 --- a/tools/slang-reflection-test/slang-reflection-test-main.cpp +++ b/tools/slang-reflection-test/slang-reflection-test-main.cpp @@ -5,8 +5,8 @@ #include <stdlib.h> #include <string.h> -#include <slang.h> -#include <slang-com-helper.h> +#include "slang.h" +#include "slang-com-helper.h" #include "../../source/core/slang-string-escape-util.h" #include "../../source/core/slang-char-util.h" diff --git a/tools/slang-test/parse-diagnostic-util.cpp b/tools/slang-test/parse-diagnostic-util.cpp index 1141f81c4..b0f13b4ee 100644 --- a/tools/slang-test/parse-diagnostic-util.cpp +++ b/tools/slang-test/parse-diagnostic-util.cpp @@ -5,7 +5,7 @@ #include "../../source/core/slang-hex-dump-util.h" #include "../../source/core/slang-type-text-util.h" -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "../../source/core/slang-string-util.h" #include "../../source/core/slang-byte-encode-util.h" diff --git a/tools/slang-test/parse-diagnostic-util.h b/tools/slang-test/parse-diagnostic-util.h index 2ad7a7911..44707b9ff 100644 --- a/tools/slang-test/parse-diagnostic-util.h +++ b/tools/slang-test/parse-diagnostic-util.h @@ -10,7 +10,7 @@ #include "../../source/compiler-core/slang-artifact-diagnostic-util.h" -#include "../../slang-com-ptr.h" +#include "slang-com-ptr.h" struct ParseDiagnosticUtil { diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index 9463cbc23..f9e07bdc9 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -11,7 +11,7 @@ #include "../../source/compiler-core/slang-artifact-desc-util.h" #include "../../source/compiler-core/slang-artifact-helper.h" -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "../../source/core/slang-string-util.h" #include "../../source/core/slang-string-escape-util.h" @@ -1629,6 +1629,17 @@ TestResult runExecutableTest(TestContext* context, TestInput& input) String modulePath = Path::combine( Path::getParentDirectory(Path::getExecutablePath()), Path::getFileNameWithoutExt(filePath)); + // String testRoot + // for(;;) + // { + // String testRoot = Path::getParentDirectory(filePath); + // if (testRoot == "") + // { + // break; + // } + // } + // printf("test folder = %s\n", testRoot.begin()); + String moduleExePath; { StringBuilder buf; @@ -1651,6 +1662,8 @@ TestResult runExecutableTest(TestContext* context, TestInput& input) args.add(moduleExePath); args.add("-target"); args.add("exe"); + args.add("-Xgenericcpp"); + args.add("-I./include"); for (auto arg : args) { // If unescaping is needed, do it diff --git a/tools/slang-test/test-context.h b/tools/slang-test/test-context.h index 7006ec905..b42ac1ec9 100644 --- a/tools/slang-test/test-context.h +++ b/tools/slang-test/test-context.h @@ -15,7 +15,7 @@ #include "../../source/compiler-core/slang-json-rpc-connection.h" -#include "../../slang-com-ptr.h" +#include "slang-com-ptr.h" #include "filecheck.h" diff --git a/tools/slang-unit-test/unit-test-com-host-callable.cpp b/tools/slang-unit-test/unit-test-com-host-callable.cpp index 57209fbde..82aa14aa4 100644 --- a/tools/slang-unit-test/unit-test-com-host-callable.cpp +++ b/tools/slang-unit-test/unit-test-com-host-callable.cpp @@ -7,9 +7,9 @@ #include "tools/unit-test/slang-unit-test.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 "../../source/core/slang-list.h" diff --git a/tools/slang-unit-test/unit-test-default-matrix-layout.cpp b/tools/slang-unit-test/unit-test-default-matrix-layout.cpp index 468b7d986..540036650 100644 --- a/tools/slang-unit-test/unit-test-default-matrix-layout.cpp +++ b/tools/slang-unit-test/unit-test-default-matrix-layout.cpp @@ -5,9 +5,9 @@ #include "tools/unit-test/slang-unit-test.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 "../../source/core/slang-list.h" diff --git a/tools/slang-unit-test/unit-test-find-check-entrypoint.cpp b/tools/slang-unit-test/unit-test-find-check-entrypoint.cpp index 371c8ae81..423b83b65 100644 --- a/tools/slang-unit-test/unit-test-find-check-entrypoint.cpp +++ b/tools/slang-unit-test/unit-test-find-check-entrypoint.cpp @@ -1,12 +1,12 @@ // unit-test-translation-unit-import.cpp -#include "../../slang.h" +#include "slang.h" #include <stdio.h> #include <stdlib.h> #include "tools/unit-test/slang-unit-test.h" -#include "../../slang-com-ptr.h" +#include "slang-com-ptr.h" #include "../../source/core/slang-io.h" #include "../../source/core/slang-process.h" diff --git a/tools/slang-unit-test/unit-test-find-type-by-name.cpp b/tools/slang-unit-test/unit-test-find-type-by-name.cpp index 87be156db..ee6ba3516 100644 --- a/tools/slang-unit-test/unit-test-find-type-by-name.cpp +++ b/tools/slang-unit-test/unit-test-find-type-by-name.cpp @@ -1,6 +1,6 @@ // unit-test-find-type-by-name.cpp -#include "../../slang.h" +#include "slang.h" #include <stdio.h> #include <stdlib.h> diff --git a/tools/slang-unit-test/unit-test-function-reflection.cpp b/tools/slang-unit-test/unit-test-function-reflection.cpp index ddbfa439b..ddcb81adc 100644 --- a/tools/slang-unit-test/unit-test-function-reflection.cpp +++ b/tools/slang-unit-test/unit-test-function-reflection.cpp @@ -1,12 +1,12 @@ // unit-test-translation-unit-import.cpp -#include "../../slang.h" +#include "slang.h" #include <stdio.h> #include <stdlib.h> #include "tools/unit-test/slang-unit-test.h" -#include "../../slang-com-ptr.h" +#include "slang-com-ptr.h" #include "../../source/core/slang-io.h" #include "../../source/core/slang-process.h" diff --git a/tools/slang-unit-test/unit-test-get-target-code.cpp b/tools/slang-unit-test/unit-test-get-target-code.cpp index a98510fd5..7cb51c91b 100644 --- a/tools/slang-unit-test/unit-test-get-target-code.cpp +++ b/tools/slang-unit-test/unit-test-get-target-code.cpp @@ -1,12 +1,12 @@ // unit-test-translation-unit-import.cpp -#include "../../slang.h" +#include "slang.h" #include <stdio.h> #include <stdlib.h> #include "tools/unit-test/slang-unit-test.h" -#include "../../slang-com-ptr.h" +#include "slang-com-ptr.h" #include "../../source/core/slang-io.h" #include "../../source/core/slang-process.h" diff --git a/tools/slang-unit-test/unit-test-translation-unit-import.cpp b/tools/slang-unit-test/unit-test-translation-unit-import.cpp index b8108644e..3b7f90c00 100644 --- a/tools/slang-unit-test/unit-test-translation-unit-import.cpp +++ b/tools/slang-unit-test/unit-test-translation-unit-import.cpp @@ -1,12 +1,12 @@ // unit-test-translation-unit-import.cpp -#include "../../slang.h" +#include "slang.h" #include <stdio.h> #include <stdlib.h> #include "tools/unit-test/slang-unit-test.h" -#include "../../slang-com-ptr.h" +#include "slang-com-ptr.h" #include "../../source/core/slang-io.h" #include "../../source/core/slang-process.h" diff --git a/tools/test-process/test-process-main.cpp b/tools/test-process/test-process-main.cpp index 9729c24b7..ea8f30c11 100644 --- a/tools/test-process/test-process-main.cpp +++ b/tools/test-process/test-process-main.cpp @@ -5,7 +5,7 @@ #include <string.h> -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "../../source/core/slang-string.h" #include "../../source/core/slang-io.h" diff --git a/tools/test-server/test-server-main.cpp b/tools/test-server/test-server-main.cpp index dc6a7916d..750fb7faf 100644 --- a/tools/test-server/test-server-main.cpp +++ b/tools/test-server/test-server-main.cpp @@ -6,7 +6,7 @@ #include "../../source/core/slang-secure-crt.h" -#include "../../slang-com-helper.h" +#include "slang-com-helper.h" #include "../../source/core/slang-string.h" #include "../../source/core/slang-io.h" diff --git a/tools/vk-pipeline-create/main.cpp b/tools/vk-pipeline-create/main.cpp index 893eecfd1..f9acd69ac 100644 --- a/tools/vk-pipeline-create/main.cpp +++ b/tools/vk-pipeline-create/main.cpp @@ -3,8 +3,8 @@ // This tools reads a gfx pipeline dump file and replays the pipeline creation to trigger // shader compilation in the driver. // -#include <slang.h> -#include <slang-com-ptr.h> +#include "slang.h" +#include "slang-com-ptr.h" #include "examples/hello-world/vulkan-api.h" #include "../../source/core/slang-string-util.h" |
