Skip to content

Commit 3431640

Browse files
Use an explicit dependency for generated headers instead of source file dependency (#6594)
* Simplify text writing for core module headers * Use an explicit dependency for generated headers instead of source file dependency From the CMake Docs > Do not list the output in more than one independent target that may build in parallel or the instances of the rule may conflict. Instead, use the add_custom_target() command to drive the command and make the other targets depend on that one. See the Example: Generating Files for Multiple Targets below. --------- Co-authored-by: Yong He <yonghe@outlook.com>
1 parent 1e20eed commit 3431640

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

source/slang-core-module/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ set(core_module_common_args
152152
slang_add_target(
153153
${core_module_common_args}
154154
TARGET_NAME slang-embedded-core-module
155-
EXPLICIT_SOURCE ${core_module_generated_header}
155+
REQUIRES generate_core_module_headers
156156
EXTRA_COMPILE_DEFINITIONS_PRIVATE SLANG_EMBED_CORE_MODULE
157157
INCLUDE_DIRECTORIES_PRIVATE ${core_module_generated_header_dir}
158158
)

source/slang/slang-options.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2260,7 +2260,7 @@ SlangResult OptionsParser::_parse(int argc, char const* const* argv)
22602260
16,
22612261
&writer));
22622262

2263-
File::writeAllText(fileName.value, builder);
2263+
File::writeNativeText(fileName.value, builder.getBuffer(), builder.getLength());
22642264
break;
22652265
}
22662266
case OptionKind::DumpIrIds:

0 commit comments

Comments
 (0)