Skip to content

Commit

Permalink
Move bulk of logic to toolchains
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebemish committed Jul 15, 2024
1 parent 18a5264 commit 51911fd
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 33 deletions.
34 changes: 1 addition & 33 deletions .github/workflows/commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,56 +13,26 @@ jobs:
build_type: [Release]
include:
- os: linux
c_compiler: gcc
cpp_compiler: g++
runner: ubuntu-latest
libname: libopensesamenative.so
java_home: "$JAVA_HOME_17_X64"
- os: macos
c_compiler: clang
cpp_compiler: clang++
runner: macos-latest
libname: libopensesamenative.dylib
java_home: "$JAVA_HOME_17_arm64"
- os: windows
c_compiler: cl
cpp_compiler: cl
runner: windows-latest
libname: opensesamenative.dll
java_home: "$JAVA_HOME_17_X64"
- os: linux
arch: i386
compiler_package: g++-i686-linux-gnu
c_compiler: i686-linux-gnu-gcc
cpp_compiler: i686-linux-gnu-g++
cmake_args: -DCMAKE_C_FLAGS="-march=i686" -DCMAKE_CXX_FLAGS="-march=i686"
- os: linux
arch: aarch64
compiler_package: g++-aarch64-linux-gnu
c_compiler: aarch64-linux-gnu-gcc
cpp_compiler: aarch64-linux-gnu-g++
cmake_args: -DCMAKE_C_FLAGS="-march=armv8-a" -DCMAKE_CXX_FLAGS="-march=armv8-a"
- os: linux
arch: arm
compiler_package: g++-arm-linux-gnueabi
c_compiler: arm-linux-gnueabi-gcc
cpp_compiler: arm-linux-gnueabi-g++
cmake_args: -DCMAKE_C_FLAGS="-march=armv7-a" -DCMAKE_CXX_FLAGS="-march=armv7-a"
- os: macos
arch: aarch64
cmake_args: -DCMAKE_OSX_ARCHITECTURES=arm64
- os: macos
arch: x86_64
cmake_args: -DCMAKE_OSX_ARCHITECTURES=x86_64
- os: windows
arch: x86_64
cmake_args: -DCMAKE_GENERATOR_PLATFORM=x64
- os: windows
arch: i386
cmake_args: -DCMAKE_GENERATOR_PLATFORM=Win32
- os: windows
arch: aarch64
cmake_args: -DCMAKE_GENERATOR_PLATFORM=ARM64
exclude:
- os: macos
arch: i386
Expand All @@ -79,11 +49,9 @@ jobs:
- name: Configure CMake
run: >
cmake -B cmakebuild
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_TOOLCHAIN_FILE=toolchains/${{ matrix.os }}-${{ matrix.arch }}.cmake
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DJAVA_HOME=${{ matrix.java_home }}
${{ matrix.cmake_args }}
-S ${{ github.workspace }}
- name: Build
run: cmake --build cmakebuild --config ${{ matrix.build_type }}
Expand Down
5 changes: 5 additions & 0 deletions toolchains/linux-aarch64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
set(CMAKE_C_FLAGS "-m64 -march=armv8-a")
set(CMAKE_CXX_FLAGS "-m64 -march=armv8-a")
5 changes: 5 additions & 0 deletions toolchains/linux-arm.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER arm-linux-gnueabi-gcc)
set(CMAKE_CXX_COMPILER arm-linux-gnueabi-g++)
set(CMAKE_C_FLAGS "-m32 -march=armv7-a")
set(CMAKE_CXX_FLAGS "-m32 -march=armv7-a")
5 changes: 5 additions & 0 deletions toolchains/linux-i386.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER i686-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER i686-linux-gnu-g++)
set(CMAKE_C_FLAGS "-m32 -march=i386")
set(CMAKE_CXX_FLAGS "-m32 -march=i386")
5 changes: 5 additions & 0 deletions toolchains/linux-x86_64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER gcc)
set(CMAKE_CXX_COMPILER g++)
set(CMAKE_C_FLAGS "-m64")
set(CMAKE_CXX_FLAGS "-m64")
4 changes: 4 additions & 0 deletions toolchains/macos-aarch64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_OSX_ARCHITECTURES "arm64")
4 changes: 4 additions & 0 deletions toolchains/macos-x86_64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
4 changes: 4 additions & 0 deletions toolchains/windows-aarch64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_C_COMPILER cl)
set(CMAKE_CXX_COMPILER cl)
set(CMAKE_GENERATOR_PLATFORM "ARM64")
4 changes: 4 additions & 0 deletions toolchains/windows-i386.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_C_COMPILER cl)
set(CMAKE_CXX_COMPILER cl)
set(CMAKE_GENERATOR_PLATFORM "Win32")
4 changes: 4 additions & 0 deletions toolchains/windows-x86_64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_C_COMPILER cl)
set(CMAKE_CXX_COMPILER cl)
set(CMAKE_GENERATOR_PLATFORM "x64")

0 comments on commit 51911fd

Please sign in to comment.