-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build and release steps for macOS and linux (#34)
Closes #28 --------- Co-authored-by: Alan Liddell <[email protected]>
- Loading branch information
1 parent
dab7964
commit 9c6d74c
Showing
4 changed files
with
153 additions
and
15 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,13 +43,77 @@ jobs: | |
with: | ||
arch: amd64_x86 | ||
|
||
- name: Package | ||
- name: CMake | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1 | ||
|
||
- name: Build | ||
run: | | ||
cmake -B ${{github.workspace}}/pack -DCMAKE_BUILD_TYPE=Release -DNOTEST=1 | ||
cmake --build ${{github.workspace}}/pack --config Release | ||
cpack --config ${{github.workspace}}/pack/CPackConfig.cmake -C Release -G ZIP | ||
cmake --build ${{github.workspace}}/build--config Release | ||
cpack --config ${{github.workspace}}/build/CPackConfig.cmake -C Release -G ZIP | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: windows-latest Release binaries | ||
path: ${{github.workspace}}/*.zip | ||
|
||
linux-build: | ||
name: "Build on Ubuntu" | ||
runs-on: | ||
- ubuntu-latest | ||
|
||
permissions: | ||
actions: write | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: CMake | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1 | ||
|
||
- name: Build | ||
run: | | ||
cmake --build ${{github.workspace}}/build --config Release | ||
cpack --config ${{github.workspace}}/build/CPackConfig.cmake -C Release -G ZIP | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: ubuntu-latest Release binaries | ||
path: ${{github.workspace}}/*.zip | ||
|
||
mac-build: | ||
name: "Build on Mac" | ||
runs-on: macos-latest | ||
|
||
permissions: | ||
actions: write | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: CMake | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" | ||
|
||
- name: Build | ||
run: | | ||
cmake --build ${{github.workspace}}/build --config Release | ||
cpack --config ${{github.workspace}}/build/CPackConfig.cmake -C Release -G ZIP | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: macos-latest Release binaries | ||
path: ${{github.workspace}}/*.zip |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,9 +61,11 @@ jobs: | |
ctest -C Release -L anyplatform --output-on-failure | ||
ctest -C Release -L acquire-driver-spinnaker --output-on-failure | ||
- name: Package | ||
- name: CMake | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1 | ||
|
||
- name: Build | ||
run: | | ||
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1 | ||
cmake --build ${{github.workspace}}/build --config Release | ||
cpack --config ${{github.workspace}}/build/CPackConfig.cmake -C Release -G ZIP | ||
|
@@ -72,9 +74,72 @@ jobs: | |
name: Windows Release binaries | ||
path: ${{github.workspace}}/*.zip | ||
|
||
linux-build: | ||
name: "Build on Ubuntu" | ||
runs-on: | ||
- ubuntu-latest | ||
|
||
permissions: | ||
actions: write | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: CMake | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1 | ||
|
||
- name: Build | ||
run: | | ||
cmake --build ${{github.workspace}}/build --config Release | ||
cpack --config ${{github.workspace}}/build/CPackConfig.cmake -C Release -G ZIP | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: ubuntu-latest Release binaries | ||
path: ${{github.workspace}}/*.zip | ||
|
||
mac-build: | ||
name: "Build on Mac" | ||
runs-on: macos-latest | ||
|
||
permissions: | ||
actions: write | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: CMake | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DNOTEST=1 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" | ||
|
||
- name: Build | ||
run: | | ||
cmake --build ${{github.workspace}}/build --config Release | ||
cpack --config ${{github.workspace}}/build/CPackConfig.cmake -C Release -G ZIP | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: macos-latest Release binaries | ||
path: ${{github.workspace}}/*.zip | ||
|
||
release: | ||
needs: | ||
- windows-build | ||
- linux-build | ||
- mac-build | ||
name: "Release" | ||
runs-on: "ubuntu-latest" | ||
|
||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
include(cmake/TargetArch.cmake) | ||
|
||
function(target_enable_simd tgt) | ||
target_architecture(arch) | ||
set(is_gcc_like "$<OR:$<COMPILE_LANG_AND_ID:CXX,AppleClang,Clang,GNU>,$<COMPILE_LANG_AND_ID:C,AppleClang,Clang,GNU>>") | ||
set(is_msvc_like "$<OR:$<COMPILE_LANG_AND_ID:CXX,MSVC>,$<COMPILE_LANG_AND_ID:C,MSVC>>") | ||
set(is_arch_x64 "$<STREQUAL:${arch},x86_64>") | ||
target_compile_options(${tgt} PRIVATE | ||
$<$<AND:${is_arch_x64},${is_gcc_like}>:-mavx2> | ||
$<$<AND:${is_arch_x64},${is_msvc_like}>:/arch:AVX2> | ||
) | ||
if(NOT APPLE) | ||
# Broken on osx github runners for some reason | ||
target_architecture(arch) | ||
set(is_gcc_like "$<OR:$<COMPILE_LANG_AND_ID:CXX,AppleClang,Clang,GNU>,$<COMPILE_LANG_AND_ID:C,AppleClang,Clang,GNU>>") | ||
set(is_msvc_like "$<OR:$<COMPILE_LANG_AND_ID:CXX,MSVC>,$<COMPILE_LANG_AND_ID:C,MSVC>>") | ||
set(is_arch_x64 "$<STREQUAL:${arch},x86_64>") | ||
target_compile_options(${tgt} PRIVATE | ||
$<$<AND:${is_arch_x64},${is_gcc_like}>:-mavx2> | ||
$<$<AND:${is_arch_x64},${is_msvc_like}>:/arch:AVX2> | ||
) | ||
endif() | ||
endfunction() |