Browse Source

Merge branch 'mono:main' into main

pull/1695/head
hxbb00 3 years ago committed by GitHub
parent
commit
9e3c1dc2fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      .github/workflows/llvm-win.yml
  2. 10
      .github/workflows/llvm.yml
  3. 3
      build/llvm/Directory.Build.props
  4. 12
      build/llvm/LLVM.lua

10
.github/workflows/llvm-win.yml

@ -9,8 +9,8 @@ jobs: @@ -9,8 +9,8 @@ jobs:
fail-fast: false
matrix:
config:
- { os: windows-2019, platform: x86, vs: 2019 }
- { os: windows-2019, platform: x64, vs: 2019 }
- { os: windows-2022, platform: x86, vs: 2022 }
- { os: windows-2022, platform: x64, vs: 2022 }
runs-on: ${{ matrix.config.os }}
@ -23,7 +23,7 @@ jobs: @@ -23,7 +23,7 @@ jobs:
steps:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v3.x
uses: rlespinasse/github-slug-action@v4
- name: Check out
shell: cmd
@ -35,7 +35,7 @@ jobs: @@ -35,7 +35,7 @@ jobs:
- name: Environment
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\%VS_VERSION%\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %PLATFORM%
call "C:\Program Files\Microsoft Visual Studio\%VS_VERSION%\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %PLATFORM%
:: Loop over all environment variables and make them global using set-env.
:: See: https://stackoverflow.com/a/39184941
setlocal
@ -60,7 +60,7 @@ jobs: @@ -60,7 +60,7 @@ jobs:
working-directory: C:\CppSharp
- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: llvm
path: C:\CppSharp\build\llvm\llvm-*-*.*

10
.github/workflows/llvm.yml

@ -9,9 +9,9 @@ jobs: @@ -9,9 +9,9 @@ jobs:
fail-fast: false
matrix:
config:
- { os: ubuntu-20.04, platform: x64, cxx: g++-9, cc: gcc-9 }
- { os: ubuntu-20.04, platform: x64, cxx: g++-10, cc: gcc-10 }
- { os: macos-10.15, platform: x64, cxx: clang++, cc: clang }
- { os: ubuntu-22.04, platform: x64, cxx: g++-11, cc: gcc-11 }
- { os: macos-11, platform: x64, cxx: clang++, cc: clang }
- { os: macos-12, platform: x64, cxx: clang++, cc: clang }
runs-on: ${{ matrix.config.os }}
@ -22,7 +22,7 @@ jobs: @@ -22,7 +22,7 @@ jobs:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: lukka/get-cmake@latest
- name: Clone LLVM
@ -38,7 +38,7 @@ jobs: @@ -38,7 +38,7 @@ jobs:
run: build/build.sh package_llvm -platform $PLATFORM
- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: llvm
path: build/llvm/llvm-*-*.*

3
build/llvm/Directory.Build.props

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
<Project>
<!-- This empty file is to workaround MSBuild picking up the root Directy.Build.props when building LLVM. -->
</Project>

12
build/llvm/LLVM.lua

@ -53,13 +53,15 @@ end @@ -53,13 +53,15 @@ end
function get_vs_version()
local function map_msvc_to_vs_version(major, minor)
if major == "19" and minor >= "20" then return "vs2019"
if major == "19" and minor >= "30" then return "vs2022"
elseif major == "19" and minor >= "20" then return "vs2019"
elseif major == "19" and minor >= "10" then return "vs2017"
end
end
local function map_msbuild_to_vs_version(major, minor)
if major == "16" then return "vs2019"
if major == "17" then return "vs2022"
elseif major == "16" then return "vs2019"
elseif major == "15" then return "vs2017"
end
end
@ -379,8 +381,6 @@ function cmake(gen, conf, builddir, options) @@ -379,8 +381,6 @@ function cmake(gen, conf, builddir, options)
.. ' -DCLANG_TOOL_C_INDEX_TEST_BUILD=false'
.. ' -DCLANG_TOOL_DIAGTOOL_BUILD=false'
.. ' -DCLANG_TOOL_DRIVER_BUILD=false'
.. ' -DCLANG_TOOL_HANDLE_CXX_BUILD=false'
.. ' -DCLANG_TOOL_HANDLE_LLVM_BUILD=false'
.. ' -DCLANG_TOOL_LIBCLANG_BUILD=false'
.. ' -DCLANG_TOOL_SCAN_BUILD_BUILD=false'
.. ' -DCLANG_TOOL_SCAN_BUILD_PY_BUILD=false'
@ -399,7 +399,9 @@ end @@ -399,7 +399,9 @@ end
function get_cmake_generator()
local vsver = get_vs_version()
if vsver == "vs2019" then
if vsver == "vs2022" then
return "Visual Studio 17 2022", (target_architecture() == "x86") and "-A Win32" or nil
elseif vsver == "vs2019" then
return "Visual Studio 16 2019", (target_architecture() == "x86") and "-A Win32" or nil
elseif vsver == "vs2017" then
return "Visual Studio 15 2017" .. (target_architecture() == "x64" and " Win64" or ""), nil

Loading…
Cancel
Save