https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cad583967ba462080a3f2…
commit cad583967ba462080a3f2ea16fbed8a9ecfd3b82
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Tue Nov 24 18:30:40 2020 +0100
Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com>
CommitDate: Mon Dec 28 12:13:30 2020 +0100
[GITHUB] Get LLVM latest version from chocolatey repository
Also, explicitly set target in toolchain file to help CMake getting things right.
---
.github/workflows/build.yml | 6 ++++--
toolchain-msvc.cmake | 28 ++++++++++++++++++++++++++++
2 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 3b61db65ac0..fc5600f9200 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -102,7 +102,9 @@ jobs:
runs-on: windows-latest
steps:
- name: Install packages
- run: choco install ninja -y
+ run: |
+ choco install ninja -y
+ choco install --x86 -y llvm
- name: Install Flex and Bison
run: |
curl -O
https://svn.reactos.org/storage/vperevertkin/flexbison.7z
@@ -121,7 +123,7 @@ jobs:
run: |
mkdir build
cd build
- $env:PATH = "$env:VCToolsInstallDir\..\..\Llvm\bin;$env:PATH"
+ $env:PATH = "${env:PROGRAMFILES(X86)}\llvm\bin;$env:PATH"
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE:FILEPATH=toolchain-msvc.cmake
-DARCH:STRING=i386 -DENABLE_ROSTESTS=1 -DENABLE_ROSAPPS=1 -DUSE_CLANG_CL:BOOL=1
${{github.workspace}}\src
- name: Build
working-directory: ${{github.workspace}}\build
diff --git a/toolchain-msvc.cmake b/toolchain-msvc.cmake
index f1ff2d77570..e30e075cba0 100644
--- a/toolchain-msvc.cmake
+++ b/toolchain-msvc.cmake
@@ -13,11 +13,38 @@ endif()
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR i686)
+# set the generator platform
+if (NOT DEFINED CMAKE_GENERATOR_PLATFORM)
+ if(ARCH STREQUAL "amd64")
+ set(CMAKE_GENERATOR_PLATFORM "x64")
+ elseif(ARCH STREQUAL "arm")
+ set(CMAKE_GENERATOR_PLATFORM "ARM")
+ elseif(ARCH STREQUAL "arm64")
+ set(CMAKE_GENERATOR_PLATFORM "ARM64")
+ else()
+ set(CMAKE_GENERATOR_PLATFORM "Win32")
+ endif()
+endif()
+
if(USE_CLANG_CL)
set(CMAKE_C_COMPILER clang-cl)
set(CMAKE_CXX_COMPILER clang-cl)
# Clang now defaults to lld-link which we're not compatible with yet
set(CMAKE_LINKER link)
+ # Explicitly set target so CMake doesn't get confused
+ if (ARCH STREQUAL "amd64")
+ set(CMAKE_C_COMPILER_TARGET "x86_64-pc-windows-msvc")
+ set(CMAKE_CXX_COMPILER_TARGET "x86_64-pc-windows-msvc")
+ elseif(ARCH STREQUAL "arm")
+ set(CMAKE_C_COMPILER_TARGET "arm-pc-windows-msvc")
+ set(CMAKE_CXX_COMPILER_TARGET "arm-pc-windows-msvc")
+ elseif(ARCH STREQUAL "arm64")
+ set(CMAKE_C_COMPILER_TARGET "arm64-pc-windows-msvc")
+ set(CMAKE_CXX_COMPILER_TARGET "arm64-pc-windows-msvc")
+ else()
+ set(CMAKE_C_COMPILER_TARGET "i686-pc-windows-msvc")
+ set(CMAKE_CXX_COMPILER_TARGET "i686-pc-windows-msvc")
+ endif()
else()
set(CMAKE_C_COMPILER cl)
set(CMAKE_CXX_COMPILER cl)
@@ -35,6 +62,7 @@ else()
set(CMAKE_ASM_COMPILER ml)
endif()
+
set(CMAKE_C_STANDARD_LIBRARIES "" CACHE INTERNAL "")
set(CMAKE_USER_MAKE_RULES_OVERRIDE
"${CMAKE_CURRENT_LIST_DIR}/overrides-msvc.cmake")