Skip to content

Commit 04369fc

Browse files
Build header units in parallel (#1529)
1 parent 839c21c commit 04369fc

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

tests/std/tests/P1502R1_standard_library_header_units/custom_format.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,21 @@ def getBuildSteps(self, test, litConfig, shared):
9898
test.flags.remove('/BE')
9999
test.compileFlags.remove('/BE')
100100

101+
exportHeaderOptions = ['/exportHeader', '/Fo', '/MP']
101102
headerUnitOptions = []
102103
for header in stlHeaders:
103-
headerObjPath = os.path.join(outputDir, header + '.obj')
104+
headerAbsolutePath = os.path.join(litConfig.cxx_headers, header)
105+
106+
exportHeaderOptions.append(headerAbsolutePath)
104107

105108
headerUnitOptions.append('/headerUnit')
106-
headerUnitOptions.append('{0}/{1}={1}.ifc'.format(litConfig.cxx_headers, header))
109+
headerUnitOptions.append('{0}={1}.ifc'.format(headerAbsolutePath, header))
107110

108111
if not compileTestCppWithEdg:
109-
headerUnitOptions.append(headerObjPath)
112+
headerUnitOptions.append(os.path.join(outputDir, header + '.obj'))
110113

111-
cmd = [test.cxx, *test.flags, *test.compileFlags,
112-
'/exportHeader', '<{}>'.format(header), '/Fo{}'.format(headerObjPath)]
113-
yield TestStep(cmd, shared.execDir, shared.env, False)
114+
cmd = [test.cxx, *test.flags, *test.compileFlags, *exportHeaderOptions]
115+
yield TestStep(cmd, shared.execDir, shared.env, False)
114116

115117
if compileTestCppWithEdg:
116118
test.compileFlags.append('/BE')

tests/std/tests/P1502R1_standard_library_header_units/custombuild.pl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,19 @@ ()
8888
"version",
8989
);
9090

91+
my $export_header_options = "/exportHeader /Fo /MP";
9192
my $header_unit_options = "";
9293

9394
foreach (@stl_headers) {
95+
$export_header_options .= " $stl_include_dir/$_";
96+
9497
$header_unit_options .= " /headerUnit";
9598
$header_unit_options .= " $stl_include_dir/$_=$_.ifc";
9699
$header_unit_options .= " $_.obj";
97-
98-
# TRANSITION, remove /DMSVC_INTERNAL_TESTING after all compiler bugs are fixed
99-
Run::ExecuteCL("/DMSVC_INTERNAL_TESTING /exportHeader \"<$_>\" /Fo$_.obj");
100100
}
101101

102102
# TRANSITION, remove /DMSVC_INTERNAL_TESTING after all compiler bugs are fixed
103+
Run::ExecuteCL("/DMSVC_INTERNAL_TESTING $export_header_options");
103104
Run::ExecuteCL("/DMSVC_INTERNAL_TESTING test.cpp /Fe$cwd.exe $header_unit_options");
104105
}
105106
1

0 commit comments

Comments
 (0)