@@ -888,7 +888,7 @@ import SWBMacro
888888 table. push ( BuiltinMacros . GCC_PREFIX_HEADER, literal: Path . root. join ( " tmp/prefix.h " ) . str)
889889 table. push ( BuiltinMacros . DERIVED_FILE_DIR, literal: Path . root. join ( " tmp/derived " ) . str)
890890 table. push ( BuiltinMacros . GCC_PRECOMPILE_PREFIX_HEADER, literal: true )
891- table. push ( BuiltinMacros . TARGET_TEMP_DIR , literal: Path . root. join ( " tmp/target-temp " ) . str)
891+ table. push ( BuiltinMacros . SHARED_PRECOMPS_DIR , literal: Path . root. join ( " tmp/precomps " ) . str)
892892 table. push ( BuiltinMacros . ALWAYS_SEARCH_USER_PATHS, literal: true )
893893 table. push ( BuiltinMacros . CLANG_ENABLE_MODULES, literal: true )
894894 table. push ( BuiltinMacros . CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING, literal: " " )
@@ -926,7 +926,7 @@ import SWBMacro
926926 let pchHash : String
927927 if core. hostOperatingSystem == . windows {
928928 // non-constant on Windows because Path.root may evaluate to any drive letter
929- pchHash = String ( ClangCompilerSpec . precompiledHeaderHashIdentifier ( commandLine: [
929+ pchHash = String ( ClangCompilerSpec . sharedPrecompiledHeaderSharingIdentifier ( commandLine: [
930930 " clang.exe " ,
931931 " -x " ,
932932 " c " ,
@@ -948,21 +948,21 @@ import SWBMacro
948948 " -I \( Path . root. join ( " tmp/derived/x86_64 " ) . str) " ,
949949 " -I \( Path . root. join ( " tmp/derived " ) . str) " ,
950950 Path . root. join ( " tmp/prefix.h " ) . str,
951- ] ) )
951+ ] ) . hashValue )
952952 } else {
953953 pchHash = " 1041705040740768206 "
954954 }
955955
956956 // Check the precompilation task
957957 let precompileTask = delegate. shellTasks. first { $0. ruleInfo. first! == " ProcessPCH " } !
958- precompileTask. checkCommandLine ( [ core. hostOperatingSystem. imageFormat. executableName ( basename: " clang " ) , " -x " , " c-header " , " -target " , " x86_64-apple-macos13.0 " , " -fmessage-length=0 " , " -fdiagnostics-show-note-include-stack " , " -fmacro-backtrace-limit=0 " , " -fno-color-diagnostics " , " -fmodules " , " -fmodules-prune-interval=86400 " , " -fmodules-prune-after=345600 " , " -Wnon-modular-include-in-framework-module " , " -Werror=non-modular-include-in-framework-module " , " -Wno-trigraphs " , " -fpascal-strings " , " -Os " , " -Wno-missing-field-initializers " , " -Wno-missing-prototypes " , " -Wno-return-type " , " -Wno-missing-braces " , " -Wparentheses " , " -Wswitch " , " -Wno-unused-function " , " -Wno-unused-label " , " -Wno-unused-parameter " , " -Wno-unused-variable " , " -Wunused-value " , " -Wno-empty-body " , " -Wno-uninitialized " , " -Wno-unknown-pragmas " , " -Wno-shadow " , " -Wno-four-char-constants " , " -Wno-conversion " , " -Wno-constant-conversion " , " -Wno-int-conversion " , " -Wno-bool-conversion " , " -Wno-enum-conversion " , " -Wno-shorten-64-to-32 " , " -Wpointer-sign " , " -Wno-newline-eof " , " -Wno-implicit-fallthrough " , " -fasm-blocks " , " -fstrict-aliasing " , " -Wdeprecated-declarations " , " -Wno-sign-conversion " , " -Wno-infinite-recursion " , " -Wno-semicolon-before-method-body " , " -iquote " , Path . root. join ( " tmp/Product-generated-files.hmap " ) . str, " -I \( Path . root. join ( " tmp/Product-own-target-headers.hmap " ) . str) " , " -I \( Path . root. join ( " tmp/Product-all-non-framework-target-headers.hmap " ) . str) " , " -ivfsoverlay " , Path ( " /--VFS/all-product-headers.yaml " ) . str, " -iquote " , Path . root. join ( " tmp/Product-project-headers.hmap " ) . str, " -I \( Path . root. join ( " tmp/derived-normal/x86_64 " ) . str) " , " -I \( Path . root. join ( " tmp/derived/x86_64 " ) . str) " , " -I \( Path . root. join ( " tmp/derived " ) . str) " , " -c " , Path . root. join ( " tmp/prefix.h " ) . str, " -MD " , " -MT " , " dependencies " , " -MF " , " \( Path . root. join ( " tmp/target-temp/PrecompiledHeaders/ \( pchHash) /prefix.h.d " ) . str) " , " -o " , " \( Path . root. join ( " tmp/target-temp/PrecompiledHeaders/ \( pchHash) /prefix.h.gch " ) . str) " , " --serialize-diagnostics " , " \( Path . root. join ( " tmp/target-temp/PrecompiledHeaders/ \( pchHash) /prefix.h.dia " ) . str) " ] )
959- #expect( precompileTask. ruleInfo == [ " ProcessPCH " , Path . root. join ( " tmp/target-temp/PrecompiledHeaders / \( pchHash) /prefix.h.gch " ) . str, Path . root. join ( " tmp/prefix.h " ) . str, " normal " , " x86_64 " , " c " , " com.apple.compilers.llvm.clang.1_0 " ] )
958+ precompileTask. checkCommandLine ( [ core. hostOperatingSystem. imageFormat. executableName ( basename: " clang " ) , " -x " , " c-header " , " -target " , " x86_64-apple-macos13.0 " , " -fmessage-length=0 " , " -fdiagnostics-show-note-include-stack " , " -fmacro-backtrace-limit=0 " , " -fno-color-diagnostics " , " -fmodules " , " -fmodules-prune-interval=86400 " , " -fmodules-prune-after=345600 " , " -Wnon-modular-include-in-framework-module " , " -Werror=non-modular-include-in-framework-module " , " -Wno-trigraphs " , " -fpascal-strings " , " -Os " , " -Wno-missing-field-initializers " , " -Wno-missing-prototypes " , " -Wno-return-type " , " -Wno-missing-braces " , " -Wparentheses " , " -Wswitch " , " -Wno-unused-function " , " -Wno-unused-label " , " -Wno-unused-parameter " , " -Wno-unused-variable " , " -Wunused-value " , " -Wno-empty-body " , " -Wno-uninitialized " , " -Wno-unknown-pragmas " , " -Wno-shadow " , " -Wno-four-char-constants " , " -Wno-conversion " , " -Wno-constant-conversion " , " -Wno-int-conversion " , " -Wno-bool-conversion " , " -Wno-enum-conversion " , " -Wno-shorten-64-to-32 " , " -Wpointer-sign " , " -Wno-newline-eof " , " -Wno-implicit-fallthrough " , " -fasm-blocks " , " -fstrict-aliasing " , " -Wdeprecated-declarations " , " -Wno-sign-conversion " , " -Wno-infinite-recursion " , " -Wno-semicolon-before-method-body " , " -iquote " , Path . root. join ( " tmp/Product-generated-files.hmap " ) . str, " -I \( Path . root. join ( " tmp/Product-own-target-headers.hmap " ) . str) " , " -I \( Path . root. join ( " tmp/Product-all-non-framework-target-headers.hmap " ) . str) " , " -ivfsoverlay " , Path ( " /--VFS/all-product-headers.yaml " ) . str, " -iquote " , Path . root. join ( " tmp/Product-project-headers.hmap " ) . str, " -I \( Path . root. join ( " tmp/derived-normal/x86_64 " ) . str) " , " -I \( Path . root. join ( " tmp/derived/x86_64 " ) . str) " , " -I \( Path . root. join ( " tmp/derived " ) . str) " , " -c " , Path . root. join ( " tmp/prefix.h " ) . str, " -MD " , " -MT " , " dependencies " , " -MF " , " \( Path . root. join ( " tmp/precomps/SharedPrecompiledHeaders/ \( pchHash) /prefix.h.d " ) . str) " , " -o " , " \( Path . root. join ( " tmp/precomps/SharedPrecompiledHeaders/ \( pchHash) /prefix.h.gch " ) . str) " , " --serialize-diagnostics " , " \( Path . root. join ( " tmp/precomps/SharedPrecompiledHeaders/ \( pchHash) /prefix.h.dia " ) . str) " ] )
959+ #expect( precompileTask. ruleInfo == [ " ProcessPCH " , Path . root. join ( " tmp/precomps/SharedPrecompiledHeaders / \( pchHash) /prefix.h.gch " ) . str, Path . root. join ( " tmp/prefix.h " ) . str, " normal " , " x86_64 " , " c " , " com.apple.compilers.llvm.clang.1_0 " ] )
960960 #expect( precompileTask. execDescription == " Precompile prefix.h (x86_64) " )
961961 precompileTask. checkInputs ( [
962962 . path( Path . root. join ( " tmp/prefix.h " ) . str)
963963 ] )
964964 precompileTask. checkOutputs ( [
965- . path( Path . root. join ( " tmp/target-temp/PrecompiledHeaders / \( pchHash) /prefix.h.gch " ) . str)
965+ . path( Path . root. join ( " tmp/precomps/SharedPrecompiledHeaders / \( pchHash) /prefix.h.gch " ) . str)
966966 ] )
967967 #expect( precompileTask. payload != nil )
968968 #expect( precompileTask. additionalOutput == [ " Precompile of \' \( Path . root. join ( " tmp/prefix.h " ) . str) \' required by \' \( Path . root. join ( " tmp/input-0.c " ) . str) \' " ] )
@@ -973,9 +973,9 @@ import SWBMacro
973973 #expect( compileTask. ruleInfo == [ " CompileC " , Path . root. join ( " tmp/output/obj-normal/x86_64/input- \( compileTaskIndex) .o " ) . str, Path . root. join ( " tmp/input- \( compileTaskIndex) .c " ) . str, " normal " , " x86_64 " , " c " , " com.apple.compilers.llvm.clang.1_0 " ] )
974974 #expect( compileTask. execDescription == " Compile input- \( compileTaskIndex) .c (x86_64) " )
975975
976- compileTask. checkCommandLine ( [ core. hostOperatingSystem. imageFormat. executableName ( basename: " clang " ) , " -x " , " c " , " -target " , " x86_64-apple-macos13.0 " , " -fmessage-length=0 " , " -fdiagnostics-show-note-include-stack " , " -fmacro-backtrace-limit=0 " , " -fno-color-diagnostics " , " -fmodules " , " -fmodules-prune-interval=86400 " , " -fmodules-prune-after=345600 " , " -Wnon-modular-include-in-framework-module " , " -Werror=non-modular-include-in-framework-module " , " -Wno-trigraphs " , " -fpascal-strings " , " -Os " , " -Wno-missing-field-initializers " , " -Wno-missing-prototypes " , " -Wno-return-type " , " -Wno-missing-braces " , " -Wparentheses " , " -Wswitch " , " -Wno-unused-function " , " -Wno-unused-label " , " -Wno-unused-parameter " , " -Wno-unused-variable " , " -Wunused-value " , " -Wno-empty-body " , " -Wno-uninitialized " , " -Wno-unknown-pragmas " , " -Wno-shadow " , " -Wno-four-char-constants " , " -Wno-conversion " , " -Wno-constant-conversion " , " -Wno-int-conversion " , " -Wno-bool-conversion " , " -Wno-enum-conversion " , " -Wno-shorten-64-to-32 " , " -Wpointer-sign " , " -Wno-newline-eof " , " -Wno-implicit-fallthrough " , " -fasm-blocks " , " -fstrict-aliasing " , " -Wdeprecated-declarations " , " -Wno-sign-conversion " , " -Wno-infinite-recursion " , " -Wno-semicolon-before-method-body " , " -iquote " , Path . root. join ( " tmp/Product-generated-files.hmap " ) . str, " -I \( Path . root. join ( " tmp/Product-own-target-headers.hmap " ) . str) " , " -I \( Path . root. join ( " tmp/Product-all-non-framework-target-headers.hmap " ) . str) " , " -ivfsoverlay " , Path ( " /--VFS/all-product-headers.yaml " ) . str, " -iquote " , Path . root. join ( " tmp/Product-project-headers.hmap " ) . str, " -I \( Path . root. join ( " tmp/derived-normal/x86_64 " ) . str) " , " -I \( Path . root. join ( " tmp/derived/x86_64 " ) . str) " , " -I \( Path . root. join ( " tmp/derived " ) . str) " , " -include " , " \( Path . root. join ( " tmp/target-temp/PrecompiledHeaders/ \( pchHash) /prefix.h " ) . str) " , " -MMD " , " -MT " , " dependencies " , " -MF " , " \( Path . root. join ( " tmp/output/obj-normal/x86_64/input- \( compileTaskIndex) .d " ) . str) " , " --serialize-diagnostics " , " \( Path . root. join ( " tmp/output/obj-normal/x86_64/input- \( compileTaskIndex) .dia " ) . str) " , " -c " , " \( Path . root. join ( " tmp/input- \( compileTaskIndex) .c " ) . str) " , " -o " , " \( Path . root. join ( " tmp/output/obj-normal/x86_64/input- \( compileTaskIndex) .o " ) . str) " ] )
976+ compileTask. checkCommandLine ( [ core. hostOperatingSystem. imageFormat. executableName ( basename: " clang " ) , " -x " , " c " , " -target " , " x86_64-apple-macos13.0 " , " -fmessage-length=0 " , " -fdiagnostics-show-note-include-stack " , " -fmacro-backtrace-limit=0 " , " -fno-color-diagnostics " , " -fmodules " , " -fmodules-prune-interval=86400 " , " -fmodules-prune-after=345600 " , " -Wnon-modular-include-in-framework-module " , " -Werror=non-modular-include-in-framework-module " , " -Wno-trigraphs " , " -fpascal-strings " , " -Os " , " -Wno-missing-field-initializers " , " -Wno-missing-prototypes " , " -Wno-return-type " , " -Wno-missing-braces " , " -Wparentheses " , " -Wswitch " , " -Wno-unused-function " , " -Wno-unused-label " , " -Wno-unused-parameter " , " -Wno-unused-variable " , " -Wunused-value " , " -Wno-empty-body " , " -Wno-uninitialized " , " -Wno-unknown-pragmas " , " -Wno-shadow " , " -Wno-four-char-constants " , " -Wno-conversion " , " -Wno-constant-conversion " , " -Wno-int-conversion " , " -Wno-bool-conversion " , " -Wno-enum-conversion " , " -Wno-shorten-64-to-32 " , " -Wpointer-sign " , " -Wno-newline-eof " , " -Wno-implicit-fallthrough " , " -fasm-blocks " , " -fstrict-aliasing " , " -Wdeprecated-declarations " , " -Wno-sign-conversion " , " -Wno-infinite-recursion " , " -Wno-semicolon-before-method-body " , " -iquote " , Path . root. join ( " tmp/Product-generated-files.hmap " ) . str, " -I \( Path . root. join ( " tmp/Product-own-target-headers.hmap " ) . str) " , " -I \( Path . root. join ( " tmp/Product-all-non-framework-target-headers.hmap " ) . str) " , " -ivfsoverlay " , Path ( " /--VFS/all-product-headers.yaml " ) . str, " -iquote " , Path . root. join ( " tmp/Product-project-headers.hmap " ) . str, " -I \( Path . root. join ( " tmp/derived-normal/x86_64 " ) . str) " , " -I \( Path . root. join ( " tmp/derived/x86_64 " ) . str) " , " -I \( Path . root. join ( " tmp/derived " ) . str) " , " -include " , " \( Path . root. join ( " tmp/precomps/SharedPrecompiledHeaders/ \( pchHash) /prefix.h " ) . str) " , " -MMD " , " -MT " , " dependencies " , " -MF " , " \( Path . root. join ( " tmp/output/obj-normal/x86_64/input- \( compileTaskIndex) .d " ) . str) " , " --serialize-diagnostics " , " \( Path . root. join ( " tmp/output/obj-normal/x86_64/input- \( compileTaskIndex) .dia " ) . str) " , " -c " , " \( Path . root. join ( " tmp/input- \( compileTaskIndex) .c " ) . str) " , " -o " , " \( Path . root. join ( " tmp/output/obj-normal/x86_64/input- \( compileTaskIndex) .o " ) . str) " ] )
977977 compileTask. checkInputs ( [
978- . path( Path . root. join ( " tmp/target-temp/PrecompiledHeaders / \( pchHash) /prefix.h.gch " ) . str) ,
978+ . path( Path . root. join ( " tmp/precomps/SharedPrecompiledHeaders / \( pchHash) /prefix.h.gch " ) . str) ,
979979 . path( Path . root. join ( " tmp/input- \( compileTaskIndex) .c " ) . str)
980980 ] )
981981 compileTask. checkOutputs ( [
0 commit comments