From 89794c0952bb9053350b7770da1ee0a2f4b4d9ac Mon Sep 17 00:00:00 2001 From: diamante0018 Date: Wed, 30 Apr 2025 11:59:49 +0200 Subject: [PATCH] build: use clang on Windows too (refactor Premake for cURL) --- .github/workflows/build.yml | 19 +++++++++++++++---- deps/premake/curl.lua | 15 +++------------ 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7025158..3f247f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,10 +25,16 @@ jobs: matrix: configuration: - release + compiler: + - msvc + - clang arch: + - x86 - x64 - arm64 include: + - arch: x86 + platform: Win32 - arch: x64 platform: x64 - arch: arm64 @@ -49,19 +55,24 @@ jobs: - name: Add msbuild to PATH uses: microsoft/setup-msbuild@main - - name: Generate project files + - name: Generate project files (clang) + if: matrix.compiler == 'clang' + run: premake5 --cc=${{matrix.compiler}} vs2022 + + - name: Generate project files (msvc) + if: matrix.compiler == 'msvc' run: premake5 vs2022 - name: Set up problem matching uses: ammaraskar/msvc-problem-matcher@master - - name: Build ${{matrix.arch}} ${{matrix.configuration}} binaries + - name: Build ${{matrix.arch}} ${{matrix.configuration}} ${{matrix.compiler}} binaries run: msbuild /m /p:Configuration=${{matrix.configuration}} /p:Platform=${{matrix.platform}} build/aw-installer.sln - - name: Upload ${{matrix.arch}} ${{matrix.configuration}} binaries + - name: Upload ${{matrix.arch}} ${{matrix.configuration}} ${{matrix.compiler}} binaries uses: actions/upload-artifact@main with: - name: windows-${{matrix.arch}}-${{matrix.configuration}} + name: windows-${{matrix.arch}}-${{matrix.configuration}}-${{matrix.compiler}} path: | build/bin/${{matrix.arch}}/${{matrix.configuration}}/aw-installer.exe build/bin/${{matrix.arch}}/${{matrix.configuration}}/aw-installer.pdb diff --git a/deps/premake/curl.lua b/deps/premake/curl.lua index 0f92f2c..2f85706 100644 --- a/deps/premake/curl.lua +++ b/deps/premake/curl.lua @@ -5,7 +5,7 @@ curl = { function curl.import() links { "curl" } - filter "toolset:msc*" + filter "system:windows" links { "Crypt32.lib" } filter {} @@ -13,7 +13,7 @@ function curl.import() end function curl.includes() -filter "toolset:msc*" +filter "system:windows" includedirs { path.join(curl.source, "include"), } @@ -49,7 +49,7 @@ function curl.project() "BUILDING_LIBCURL", } - filter "toolset:msc*" + filter "system:windows" defines { "USE_SCHANNEL", @@ -58,15 +58,6 @@ function curl.project() } filter {} - - filter "toolset:not msc*" - - defines { - "USE_GNUTLS", - "USE_THREADS_POSIX", - } - - filter {} warnings "Off" kind "StaticLib"