Skip to content

Commit f0c3c65

Browse files
committed
Use CMake Visual Studio generator instead of Ninja
1 parent ffdb4a6 commit f0c3c65

File tree

6 files changed

+9
-29
lines changed

6 files changed

+9
-29
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ jobs:
2121
# delete /c/Strawberry/c/bin/gmake built for MinGW that is found on runners, because we must use make built for MSYS
2222
run: if GMAKE_PATH=`which gmake`; then rm -f "$GMAKE_PATH"; fi
2323
shell: msys2 {0}
24-
- name: Install Windows packages
25-
run: choco install ninja
2624
- uses: ilammy/msvc-dev-cmd@v1
2725
with:
2826
arch: ${{ matrix.arch }}

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ The MSYS2 installation is required to provide the Bash shell and Unix tools requ
3232
- Clang (via Visual Studio or `choco install llvm`)
3333
- CMake (via Visual Studio or `choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'`)
3434
- Git (`choco install git`)
35-
- Ninja (`choco install ninja`)
3635
- MSYS2 (`choco install msys2`)
3736

3837
**Unix tools**

build.bat

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ where git
8383
if %errorlevel% neq 0 call :error_missing_command git, "'choco install git'"
8484
where cmake
8585
if %errorlevel% neq 0 call :error_missing_command cmake, "Visual Studio or 'choco install cmake --installargs ADD_CMAKE_TO_PATH=System'"
86-
where ninja
87-
if %errorlevel% neq 0 call :error_missing_command ninja, "'choco install ninja'"
8886
where clang-cl
8987
if %errorlevel% neq 0 call :error_missing_command clang-cl, "Visual Studio or 'choco install llvm'"
9088
call %BASH% 'true'

phases/11-libobjc2.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ cmake .. %CMAKE_OPTIONS% ^
2323
echo.
2424
echo ### Building
2525
set CCC_OVERRIDE_OPTIONS=x-TC x-TP x/TC x/TP
26-
ninja || exit /b 1
26+
cmake %CMAKE_BUILD_OPTIONS% || exit /b 1
2727
set CCC_OVERRIDE_OPTIONS=
2828

2929
echo.
3030
echo ### Installing
31-
ninja install || exit /b 1
31+
cmake %CMAKE_INSTALL_OPTIONS% || exit /b 1
3232

3333
:: Install PDB files
3434
xcopy /Y /F objc.pdb "%INSTALL_PREFIX%\lib\"

phases/18-libdispatch.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ cmake .. %CMAKE_OPTIONS% ^
2828

2929
echo.
3030
echo ### Building
31-
ninja || exit /b 1
31+
cmake %CMAKE_BUILD_OPTIONS% || exit /b 1
3232

3333
echo.
3434
echo ### Installing
35-
ninja install || exit /b 1
35+
cmake %CMAKE_INSTALL_OPTIONS% || exit /b 1
3636

3737
:: Install PDB file
3838
xcopy /Y /F dispatch.pdb "%INSTALL_PREFIX%\lib\"

scripts/sdkenv.bat

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,26 +39,11 @@ if "%ARCH%" == "x86" (
3939
exit /b 1
4040
)
4141

42-
:: add flags for cross compilation
43-
if not "%VSCMD_ARG_HOST_ARCH%" == "" (
44-
if not "%VSCMD_ARG_HOST_ARCH%" == "%ARCH%" (
45-
if "%ARCH%" == "x86" (
46-
set FLAGS=-m32
47-
) else if "%ARCH%" == "x64" (
48-
set FLAGS=-m64
49-
)
50-
set "CFLAGS=%FLAGS% %CFLAGS%"
51-
set "CXXFLAGS=%FLAGS% %CXXFLAGS%"
52-
set "LDFLAGS=%FLAGS% %LDFLAGS%"
53-
)
54-
)
55-
5642
:: Common CMake options
43+
set CMAKE_ARCH=%ARCH%
44+
if "%ARCH%" == "x86" set CMAKE_ARCH=Win32
5745
set CMAKE_BUILD_TYPE=%BUILD_TYPE%
5846
if "%BUILD_TYPE%" == "Release" set CMAKE_BUILD_TYPE=RelWithDebInfo
59-
set CMAKE_OPTIONS=^
60-
-G Ninja ^
61-
-D CMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
62-
-D CMAKE_INSTALL_PREFIX="%INSTALL_PREFIX%" ^
63-
-D CMAKE_C_COMPILER=clang-cl ^
64-
-D CMAKE_CXX_COMPILER=clang-cl ^
47+
set CMAKE_OPTIONS=-T ClangCL -A %CMAKE_ARCH% -DCMAKE_INSTALL_PREFIX="%INSTALL_PREFIX%"
48+
set CMAKE_BUILD_OPTIONS=--build . --config %CMAKE_BUILD_TYPE% -- -m
49+
set CMAKE_INSTALL_OPTIONS=--build . --config %CMAKE_BUILD_TYPE% --target install

0 commit comments

Comments
 (0)