diff options
| -rw-r--r-- | source/slang/slang-compiler-options.cpp | 16 | ||||
| -rw-r--r-- | tests/spirv/cmd-arg-debug-info.slang | 5 |
2 files changed, 18 insertions, 3 deletions
diff --git a/source/slang/slang-compiler-options.cpp b/source/slang/slang-compiler-options.cpp index 9b7091756..8a27f6fce 100644 --- a/source/slang/slang-compiler-options.cpp +++ b/source/slang/slang-compiler-options.cpp @@ -54,11 +54,21 @@ void CompilerOptionSet::writeCommandLineArgs(Session* globalSession, StringBuild switch (option.key) { case CompilerOptionName::Capability: - for (auto v : option.value) { - sb << " " << optionInfo.names << " " << v.stringValue; + StringBuilder subBuilder; + for (auto v : option.value) + { + if (subBuilder.getLength() != 0) + subBuilder << "+"; + if (v.kind == CompilerOptionValueKind::Int) + subBuilder << capabilityNameToString((CapabilityName)v.intValue); + else + subBuilder << v.stringValue; + } + if (subBuilder.getLength()) + sb << " " << optionInfo.names << " " << subBuilder.produceString(); + break; } - break; case CompilerOptionName::Include: for (auto v : option.value) { diff --git a/tests/spirv/cmd-arg-debug-info.slang b/tests/spirv/cmd-arg-debug-info.slang new file mode 100644 index 000000000..da5cebad0 --- /dev/null +++ b/tests/spirv/cmd-arg-debug-info.slang @@ -0,0 +1,5 @@ +//TEST:SIMPLE(filecheck=CHECK): -target spirv -g3 -emit-spirv-directly -profile sm_6_6+spirv_1_5 +// CHECK: OpString "-target spirv {{.*}} -capability spirv_1_5 +[numthreads(1,1,1)] +void computeMain() +{}
\ No newline at end of file |
