Skip to content

Commit 7ffffd0

Browse files
authored
build: add a workaround for CMake 3.20
CMake 3.20 had a bug on the release where the user supplied paths would be processed without conversion. This adds a workaround by using `cygpath` to convert the path to a mixed model style which should avoid the problem. Cherry-picked from 3c9dd08.
1 parent e21086d commit 7ffffd0

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

utils/build-windows.bat

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ call :build_swift %exitOnError%
7979

8080
call :build_lldb %exitOnError%
8181

82+
path %PATH%;C:\Program Files\Git\usr\bin
8283
call :build_libdispatch %exitOnError%
8384

84-
path %source_root%\icu-%icu_version%\bin64;%install_directory%\bin;%build_root%\swift\bin;%build_root%\swift\libdispatch-prefix\bin;%PATH%;C:\Program Files\Git\usr\bin
85+
path %source_root%\icu-%icu_version%\bin64;%install_directory%\bin;%build_root%\swift\bin;%build_root%\swift\libdispatch-prefix\bin;%PATH%
8586
call :test_swift %exitOnError%
8687
call :test_libdispatch %exitOnError%
8788

@@ -120,7 +121,7 @@ git -C "%source_root%\swift" checkout-index --force --all
120121
@set "skip_repositories_arg=%skip_repositories_arg% --skip-repository tensorflow-swift-apis"
121122
@set "skip_repositories_arg=%skip_repositories_arg% --skip-repository yams"
122123

123-
call "%source_root%\swift\utils\update-checkout.cmd" %scheme_arg% %skip_repositories_arg% --clone --skip-history --github-comment "%ghprbCommentBody%" >NUL 2>NUL
124+
call "%source_root%\swift\utils\update-checkout.cmd" %scheme_arg% %skip_repositories_arg% --clone --skip-history --skip-tags --github-comment "%ghprbCommentBody%" >NUL 2>NUL
124125

125126
goto :eof
126127
endlocal
@@ -268,13 +269,15 @@ cmake^
268269
-DSWIFT_BUILD_SOURCEKIT:BOOL=YES^
269270
-DSWIFT_ENABLE_SOURCEKIT_TESTS:BOOL=YES^
270271
-DSWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=YES^
272+
-DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=YES^
271273
-DSWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING=YES^
272274
-DSWIFT_INSTALL_COMPONENTS="autolink-driver;compiler;clang-resource-dir-symlink;stdlib;sdk-overlay;editor-integration;tools;sourcekit-inproc;swift-remote-mirror;swift-remote-mirror-headers"^
273275
-DSWIFT_PARALLEL_LINK_JOBS=8^
274276
-DPYTHON_EXECUTABLE:PATH=%PYTHON_HOME%\python.exe^
275277
-DCMAKE_CXX_FLAGS:STRING="/GS- /Oy"^
276278
-DCMAKE_EXE_LINKER_FLAGS:STRING=/INCREMENTAL:NO^
277279
-DCMAKE_SHARED_LINKER_FLAGS:STRING=/INCREMENTAL:NO^
280+
-DSWIFT_LIT_ARGS="--time-tests"^
278281
-S "%source_root%\swift" %exitOnError%
279282

280283
cmake --build "%build_root%\swift" %exitOnError%
@@ -331,6 +334,8 @@ endlocal
331334
:: Configures, builds, and installs Dispatch
332335
setlocal enableextensions enabledelayedexpansion
333336

337+
for /f "delims=" %%O in ('cygpath -m %install_directory%\lib\swift') do set RESOURCE_DIR=%%O
338+
334339
cmake^
335340
-B "%build_root%\swift-corelibs-libdispatch"^
336341
-G Ninja^
@@ -350,8 +355,8 @@ cmake^
350355
-DCMAKE_EXE_LINKER_FLAGS:STRING="/INCREMENTAL:NO"^
351356
-DCMAKE_SHARED_LINKER_FLAGS:STRING="/INCREMENTAL:NO"^
352357
-DCMAKE_Swift_COMPILER_TARGET:STRING=x86_64-unknown-windows-msvc^
353-
-DCMAKE_Swift_FLAGS:STRING="-resource-dir \"%install_directory%\lib\swift\""^
354-
-DCMAKE_Swift_LINK_FLAGS:STRING="-resource-dir \"%install_directory%\lib\swift\""^
358+
-DCMAKE_Swift_FLAGS:STRING="-resource-dir \"%RESOURCE_DIR%\""^
359+
-DCMAKE_Swift_LINK_FLAGS:STRING="-resource-dir \"%RESOURCE_DIR%\""^
355360
-S "%source_root%\swift-corelibs-libdispatch" %exitOnError%
356361

357362
cmake --build "%build_root%\swift-corelibs-libdispatch" %exitOnError%

0 commit comments

Comments
 (0)