Skip to content

Commit 5aaaae5

Browse files
committed
[CMake] Ensure module tracing is off during configuration
Such module usages are not relevant for the final build, they are used only to detect the capabilities of the compiler. This generalizes #68453, and would be needed for Apple internal configurations that set `SWIFT_LOADED_MODULE_TRACE_FILE` when building the compiler. Addresses rdar://124954349
1 parent 0f5dc13 commit 5aaaae5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ include(FetchContent)
100100
# optional until we have a bootstrap story.
101101
check_language(Swift)
102102
if(CMAKE_Swift_COMPILER)
103+
# we are not interested in logging any Swift module used
104+
# when configuring the build system -- those are not useful
105+
# since they will not contribute to the build of the compiler itself
106+
unset(ENV{SWIFT_LOADED_MODULE_TRACE_FILE})
107+
103108
enable_language(Swift)
104109
set(DEFAULT_SWIFT_MIN_RUNTIME_VERSION "${CMAKE_Swift_COMPILER_VERSION}")
105110
else()

cmake/modules/SwiftImplicitImport.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ function(swift_supports_implicit_module module_name out_var)
33
file(WRITE "${CMAKE_BINARY_DIR}/tmp/empty-check-${module_name}.swift" "")
44
execute_process(
55
COMMAND
6-
${CMAKE_COMMAND}
7-
-E env --unset=SWIFT_LOADED_MODULE_TRACE_FILE
86
"${CMAKE_Swift_COMPILER}"
97
-Xfrontend -disable-implicit-${module_name}-module-import
108
-Xfrontend -parse-stdlib

0 commit comments

Comments
 (0)