[cmake] Do not use dll symbol in static libraries #151
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: MSYS2 | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
CC: /mingw64/bin/gcc | |
CXX: /mingw64/bin/g++ | |
MSYS2_ARG_CONV_EXCL: -DCMAKE_INSTALL_PREFIX= | |
CXXFLAGS_COV: -fprofile-arcs -ftest-coverage | |
jobs: | |
build: | |
name: "${{matrix.BUILD_TYPE}} build${{matrix.with_llvm && (matrix.static_llvm && ' (static LLVM)' || ' (shared LLVM)') || ' (no LLVM)'}}" | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
BUILD_TYPE: [ Release, Debug ] | |
with_llvm: [ true, false ] | |
static_llvm: [ true ] | |
include: | |
- BUILD_TYPE: Release | |
with_llvm: true | |
static_llvm: false | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download MSYS2 packages | |
uses: actions/github-script@v4 | |
with: | |
script: | | |
const fs = require('fs'); | |
const release = (await github.repos.getLatestRelease({ | |
owner: 'nacs-lab', | |
repo: 'nacs-pkgs' | |
})).data; | |
for (let asset of release.assets) { | |
if (asset.name == 'msys2-packages.zip') { | |
const file = fs.createWriteStream('msys2-packages.zip'); | |
core.info(`Downloading msys2-packages.zip from release ${release.name}`); | |
const buffer = (await github.repos.getReleaseAsset({ | |
headers: { Accept: 'application/octet-stream' }, | |
owner: 'nacs-lab', | |
repo: 'nacs-pkgs', | |
asset_id: asset.id, | |
})).data; | |
file.write(Buffer.from(buffer)); | |
file.end(); | |
return; | |
} | |
} | |
core.setFailed('Cannot find msys2-packages.zip from nacs-lab/nacs-pkgs'); | |
- uses: msys2/setup-msys2@v2 | |
with: | |
msystem: MINGW64 | |
install: >- | |
make | |
mingw-w64-x86_64-cmake | |
mingw-w64-x86_64-toolchain | |
mingw-w64-x86_64-libwinpthread | |
mingw-w64-x86_64-llvm | |
mingw-w64-x86_64-openlibm | |
mingw-w64-x86_64-polly | |
mingw-w64-x86_64-tbb | |
mingw-w64-x86_64-yaml-cpp | |
mingw-w64-x86_64-zeromq | |
mingw-w64-x86_64-cppzmq | |
unzip | |
- name: Install sleef | |
shell: msys2 {0} | |
run: | | |
unzip msys2-packages.zip | |
pacman -U --noconfirm msys2-packages/mingw-w64-x86_64-sleef-git-*.pkg.tar.* | |
- name: Configure CMake | |
shell: msys2 {0} | |
run: CXXFLAGS+=" ${CXXFLAGS_COV}" cmake -B '${{github.workspace}}/build' -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} -DENABLE_SIMD=On -DENABLE_LLVM=${{matrix.with_llvm && 'On' || 'Off'}} -DSTATIC_LLVM=${{matrix.static_llvm && 'On' || 'Off'}} -DCMAKE_INSTALL_PREFIX=/mingw64 -G 'MSYS Makefiles' | |
- name: Build | |
shell: msys2 {0} | |
run: cmake --build '${{github.workspace}}/build' --config ${{matrix.BUILD_TYPE}} -j $(nproc) | |
- name: Builder info | |
shell: msys2 {0} | |
working-directory: ${{github.workspace}}/build | |
run: output-bin/nacs-cpudump | |
- name: Test | |
shell: msys2 {0} | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{matrix.BUILD_TYPE}} -E /excluded --output-on-failure -j $(nproc) | |
- name: Generate coverage report | |
shell: msys2 {0} | |
run: | | |
find build/{lib,tools} -iname '*.obj' -exec /mingw64/bin/gcov -abcfupr {} -s $(cygpath -u '${{github.workspace}}') \; | |
- name: Upload coverage | |
uses: codecov/codecov-action@v2 |