Skip to content

Commit 780fa8e

Browse files
authored
chore: fix Cross Compilation GHA (#755)
1 parent bca774f commit 780fa8e

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

.github/workflows/build-develop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: Configure CMake
5353
shell: bash
5454
working-directory: ${{github.workspace}}/build
55-
run: PKG_CONFIG_PATH=${{github.workspace}}/local/lib/pkgconfig cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake
55+
run: PKG_CONFIG_PATH=${{github.workspace}}/local/lib/pkgconfig cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake -DCONAN_INSTALL_ARGS="--build=missing;-c=corrade/*:tools.build:cxxflags=['-include','vector']"
5656

5757
- name: Build
5858
working-directory: ${{github.workspace}}/build
@@ -108,7 +108,7 @@ jobs:
108108
run: sudo ctest --output-on-failure
109109

110110
build-win64:
111-
runs-on: windows-2019
111+
runs-on: windows-latest
112112
outputs:
113113
version_number: ${{ env.VERSION }}
114114
steps:

.github/workflows/build-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ jobs:
155155
prerelease: false
156156

157157
build-win64:
158-
runs-on: windows-2019
158+
runs-on: windows-latest
159159
outputs:
160160
version_number: ${{ env.VERSION }}
161161
steps:

.github/workflows/build_cross.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ jobs:
2121
include:
2222
- arch: x86_64
2323
conan_arch: x86_64
24-
toolchain: http://musl.cc/x86_64-linux-musl-cross.tgz
24+
toolchain: https://github.com/netboxlabs/pktvisor/releases/download/toolchains/x86_64-linux-musl-cross.tgz
2525
cc: x86_64-linux-musl-gcc
2626
cxx: x86_64-linux-musl-g++
2727
ldflags: "-static"
2828
# - arch: armv7lh # ARMv7 little-endian hard-float
2929
# conan_arch: armv7hf
30-
# toolchain: http://musl.cc/armv7l-linux-musleabihf-cross.tgz
30+
# toolchain: https://github.com/netboxlabs/pktvisor/releases/download/toolchains/armv7l-linux-musleabihf-cross.tgz
3131
# cc: armv7l-linux-musleabihf-gcc
3232
# cxx: armv7l-linux-musleabihf-g++
3333
- arch: aarch64
3434
conan_arch: armv8
35-
toolchain: http://musl.cc/aarch64-linux-musl-cross.tgz
35+
toolchain: https://github.com/netboxlabs/pktvisor/releases/download/toolchains/aarch64-linux-musl-cross.tgz
3636
cc: aarch64-linux-musl-gcc
3737
cxx: aarch64-linux-musl-g++
3838
ldflags: "-static"

cmake/conan_provider.cmake

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ function(detect_os os os_api_level os_sdk os_subsystem os_version)
5050
elseif(CMAKE_SYSTEM_NAME MATCHES "^MSYS")
5151
set(${os} Windows PARENT_SCOPE)
5252
set(${os_subsystem} msys2 PARENT_SCOPE)
53+
elseif(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
54+
# https://github.com/emscripten-core/emscripten/blob/4.0.6/cmake/Modules/Platform/Emscripten.cmake#L17C1-L17C34
55+
set(${os} Emscripten PARENT_SCOPE)
5356
else()
5457
set(${os} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
5558
endif()
@@ -123,6 +126,10 @@ function(detect_arch arch)
123126
elseif(host_arch MATCHES "AMD64|amd64|x86_64|x64")
124127
set(_arch x86_64)
125128
endif()
129+
if(EMSCRIPTEN)
130+
# https://github.com/emscripten-core/emscripten/blob/4.0.6/cmake/Modules/Platform/Emscripten.cmake#L294C1-L294C80
131+
set(_arch wasm)
132+
endif()
126133
message(STATUS "CMake-Conan: cmake_system_processor=${_arch}")
127134
set(${arch} ${_arch} PARENT_SCOPE)
128135
endfunction()
@@ -268,15 +275,15 @@ function(detect_compiler compiler compiler_version compiler_runtime compiler_run
268275

269276
elseif(_compiler MATCHES AppleClang)
270277
set(_compiler "apple-clang")
271-
string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
278+
string(REPLACE "." ";" VERSION_LIST ${_compiler_version})
272279
list(GET VERSION_LIST 0 _compiler_version)
273280
elseif(_compiler MATCHES Clang)
274281
set(_compiler "clang")
275-
string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
282+
string(REPLACE "." ";" VERSION_LIST ${_compiler_version})
276283
list(GET VERSION_LIST 0 _compiler_version)
277284
elseif(_compiler MATCHES GNU)
278285
set(_compiler "gcc")
279-
string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
286+
string(REPLACE "." ";" VERSION_LIST ${_compiler_version})
280287
list(GET VERSION_LIST 0 _compiler_version)
281288
endif()
282289

0 commit comments

Comments
 (0)