Skip to content

Commit

Permalink
try brew clang
Browse files Browse the repository at this point in the history
  • Loading branch information
lkeegan committed Aug 11, 2023
1 parent ddde239 commit 9373a4f
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 137 deletions.
274 changes: 137 additions & 137 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,41 @@ env:
ZLIB_VERSION: "v1.2.13" # not used for msvc builds

jobs:
linux:
name: Linux
runs-on: ubuntu-20.04
env:
INSTALL_PREFIX: "/opt/smelibs"
SUDO_CMD: "sudo"
# legacy opengl option prevents qt from depending on libOpenGL: https://bugreports.qt.io/browse/QTBUG-89754
CONFIGURE_EXTRAS: "-DFEATURE_xcb=ON -DINPUT_bundled_xcb_xinput=yes -DFEATURE_libudev=OFF -DOpenGL_GL_PREFERENCE=LEGACY"
OS: "linux"
CC: "clang"
CXX: "clang++"
defaults:
run:
shell: bash
steps:
- name: Add llvm repo for clang 16
run: |
sudo wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main"
- name: Install Qt build dependencies
run: |
sudo apt update -yy
sudo apt install -yy clang-16 libglu1-mesa-dev ninja-build libx11-dev libx11-xcb-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxkbcommon-dev libxkbcommon-x11-dev '^libxcb.*-dev'
- name: Set clang version
run: |
sudo update-alternatives --remove-all clang || echo "nothing to remove"
sudo update-alternatives --remove-all clang++ || echo "nothing to remove"
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 100
- uses: actions/checkout@v3
- name: Build script
run: ./build.sh
- uses: actions/upload-artifact@v3
with:
path: ./artefacts/*
# linux:
# name: Linux
# runs-on: ubuntu-20.04
# env:
# INSTALL_PREFIX: "/opt/smelibs"
# SUDO_CMD: "sudo"
# # legacy opengl option prevents qt from depending on libOpenGL: https://bugreports.qt.io/browse/QTBUG-89754
# CONFIGURE_EXTRAS: "-DFEATURE_xcb=ON -DINPUT_bundled_xcb_xinput=yes -DFEATURE_libudev=OFF -DOpenGL_GL_PREFERENCE=LEGACY"
# OS: "linux"
# CC: "clang"
# CXX: "clang++"
# defaults:
# run:
# shell: bash
# steps:
# - name: Add llvm repo for clang 16
# run: |
# sudo wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
# sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main"
# - name: Install Qt build dependencies
# run: |
# sudo apt update -yy
# sudo apt install -yy clang-16 libglu1-mesa-dev ninja-build libx11-dev libx11-xcb-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxkbcommon-dev libxkbcommon-x11-dev '^libxcb.*-dev'
# - name: Set clang version
# run: |
# sudo update-alternatives --remove-all clang || echo "nothing to remove"
# sudo update-alternatives --remove-all clang++ || echo "nothing to remove"
# sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 100
# sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 100
# - uses: actions/checkout@v3
# - name: Build script
# run: ./build.sh
# - uses: actions/upload-artifact@v3
# with:
# path: ./artefacts/*

macos:
name: MacOS
Expand All @@ -52,120 +52,120 @@ jobs:
MACOSX_DEPLOYMENT_TARGET: "11.0"
CONFIGURE_EXTRAS: ""
OS: "osx"
CXX: "g++-13"
CC: "gcc-13"
CXX: "clang++-16"
CC: "clang-16"
defaults:
run:
shell: bash
steps:
- name: Brew install ninja / gcc13
run: brew install ninja gcc@13
- name: Brew install ninja / clang
run: brew install ninja llvm@16
- uses: actions/checkout@v3
- name: Build script
run: ./build.sh
- uses: actions/upload-artifact@v3
with:
path: ./artefacts/*

win64-mingw:
name: Windows 64-bit Mingw
runs-on: windows-2022
env:
INSTALL_PREFIX: "/c/smelibs"
SUDO_CMD: ""
CONFIGURE_EXTRAS: "-DQT_QMAKE_TARGET_MKSPEC=win32-g++"
OS: "win64-mingw"
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja git
- name: Build script
run: ./build.sh
- uses: actions/upload-artifact@v3
with:
path: ./artefacts/*
# win64-mingw:
# name: Windows 64-bit Mingw
# runs-on: windows-2022
# env:
# INSTALL_PREFIX: "/c/smelibs"
# SUDO_CMD: ""
# CONFIGURE_EXTRAS: "-DQT_QMAKE_TARGET_MKSPEC=win32-g++"
# OS: "win64-mingw"
# defaults:
# run:
# shell: msys2 {0}
# steps:
# - uses: actions/checkout@v3
# - uses: msys2/setup-msys2@v2
# with:
# msystem: MINGW64
# update: true
# install: mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja git
# - name: Build script
# run: ./build.sh
# - uses: actions/upload-artifact@v3
# with:
# path: ./artefacts/*

win32-mingw:
name: Windows 32-bit Mingw
runs-on: windows-2022
env:
INSTALL_PREFIX: "/c/smelibs"
SUDO_CMD: ""
CONFIGURE_EXTRAS: "-DQT_QMAKE_TARGET_MKSPEC=win32-g++"
OS: "win32-mingw"
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
update: true
install: mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-ninja git
- name: Build script
run: ./build.sh
- uses: actions/upload-artifact@v3
with:
path: ./artefacts/*
# win32-mingw:
# name: Windows 32-bit Mingw
# runs-on: windows-2022
# env:
# INSTALL_PREFIX: "/c/smelibs"
# SUDO_CMD: ""
# CONFIGURE_EXTRAS: "-DQT_QMAKE_TARGET_MKSPEC=win32-g++"
# OS: "win32-mingw"
# defaults:
# run:
# shell: msys2 {0}
# steps:
# - uses: actions/checkout@v3
# - uses: msys2/setup-msys2@v2
# with:
# msystem: MINGW32
# update: true
# install: mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-ninja git
# - name: Build script
# run: ./build.sh
# - uses: actions/upload-artifact@v3
# with:
# path: ./artefacts/*

win64-msvc:
name: Windows 64-bit MSVC
runs-on: windows-2022
env:
INSTALL_PREFIX: 'C:\smelibs'
OS: "win64-msvc"
steps:
- uses: actions/checkout@v3
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
toolset: 14.0
- name: Build script
run: ./build.ps1
- uses: actions/upload-artifact@v3
with:
path: ./artefacts/*
# win64-msvc:
# name: Windows 64-bit MSVC
# runs-on: windows-2022
# env:
# INSTALL_PREFIX: 'C:\smelibs'
# OS: "win64-msvc"
# steps:
# - uses: actions/checkout@v3
# - uses: ilammy/msvc-dev-cmd@v1
# with:
# arch: amd64
# toolset: 14.0
# - name: Build script
# run: ./build.ps1
# - uses: actions/upload-artifact@v3
# with:
# path: ./artefacts/*

win32-msvc:
name: Windows 32-bit MSVC
runs-on: windows-2022
env:
INSTALL_PREFIX: 'C:\smelibs'
OS: "win32-msvc"
steps:
- uses: actions/checkout@v3
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64_x86
toolset: 14.0
- name: Build script
run: ./build.ps1
- uses: actions/upload-artifact@v3
with:
path: ./artefacts/*
# win32-msvc:
# name: Windows 32-bit MSVC
# runs-on: windows-2022
# env:
# INSTALL_PREFIX: 'C:\smelibs'
# OS: "win32-msvc"
# steps:
# - uses: actions/checkout@v3
# - uses: ilammy/msvc-dev-cmd@v1
# with:
# arch: amd64_x86
# toolset: 14.0
# - name: Build script
# run: ./build.ps1
# - uses: actions/upload-artifact@v3
# with:
# path: ./artefacts/*

release:
needs: [linux, macos, win64-mingw, win32-mingw, win64-msvc, win32-msvc]
runs-on: ubuntu-latest
# upload binaries to github release if commit is tagged
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: binaries
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: binaries/*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
# release:
# needs: [linux, macos, win64-mingw, win32-mingw, win64-msvc, win32-msvc]
# runs-on: ubuntu-latest
# # upload binaries to github release if commit is tagged
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: artifact
# path: binaries
# - name: Upload binaries to release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: binaries/*
# tag: ${{ github.ref }}
# overwrite: true
# file_glob: true
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ cmake -G "Ninja" .. \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_C_FLAGS="-fpic -fvisibility=hidden" \
-DCMAKE_CXX_FLAGS="-fpic -fvisibility=hidden" \
-DCMAKE_STATIC_LINKER_FLAGS="-L$HOMEBREW_PREFIX/opt/llvm/lib/c++ -Wl,-rpath,$HOMEBREW_PREFIX/opt/llvm/lib/c++" \
-DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX"
time ninja zlibstatic
# manual install to avoid shared libs being installed & issues with compiling example programs
Expand All @@ -54,6 +55,7 @@ mkdir build
cd build
cmake ../qt5/qtbase -G "Ninja" \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_STATIC_LINKER_FLAGS="-L$HOMEBREW_PREFIX/opt/llvm/lib/c++ -Wl,-rpath,$HOMEBREW_PREFIX/opt/llvm/lib/c++" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
-DCMAKE_MESSAGE_LOG_LEVEL=STATUS \
Expand Down

0 comments on commit 9373a4f

Please sign in to comment.