Skip to content

Commit

Permalink
Change toolchain file setup
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebemish committed Jul 16, 2024
1 parent cfb25ce commit 69ec35e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ jobs:
shell: bash
run: >
cmake -B cmakebuild
-DCMAKE_TOOLCHAIN_FILE="toolchains/${{ matrix.os }}-${{ matrix.arch }}.cmake"
--toolchain="toolchains/${{ matrix.os }}-${{ matrix.arch }}.cmake"
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: Configure CMake
if: ${{ matrix.msys }}
shell: msys2 {0}
run: >
cmake -B cmakebuild
-DCMAKE_TOOLCHAIN_FILE="toolchains/${{ matrix.os }}-${{ matrix.arch }}.cmake"
--toolchain="toolchains/${{ matrix.os }}-${{ matrix.arch }}.cmake"
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: Build
if: ${{ !matrix.msys }}
Expand Down
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ project(OpenSesameNatives
LANGUAGES CXX C)

add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/jni_headers/src/java.base/share/native/include"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/jni_headers/src/java.base/unix/native/include"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/jni_headers/src/java.base/windows/native/include"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/jni_headers/src/java.base/share/native/include/"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/jni_headers/src/java.base/unix/native/include/"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/jni_headers/src/java.base/windows/native/include/"
COMMAND bash -c "mkdir -p \"${CMAKE_CURRENT_BINARY_DIR}/jni_headers\""
COMMAND bash -c "git -C \"${CMAKE_CURRENT_BINARY_DIR}/jni_headers\" init"
COMMAND bash -c "git -C \"${CMAKE_CURRENT_BINARY_DIR}/jni_headers\" remote add origin https://github.com/openjdk/jdk.git"
Expand Down Expand Up @@ -36,4 +36,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_include_directories(opensesamenative PUBLIC
"${CMAKE_CURRENT_BINARY_DIR}/jni_headers/src/java.base/windows/native/include")
endif()

set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_SHARED_MODULE_PREFIX "")
set(CMAKE_STATIC_LIBRARY_PREFIX "")
endif()
1 change: 0 additions & 1 deletion toolchains/windows-aarch64.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_C_COMPILER clang)
set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_C_FLAGS "-march=armv8-a")
set(CMAKE_CXX_FLAGS "-march=armv8-a")
1 change: 0 additions & 1 deletion toolchains/windows-i386.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_C_COMPILER i686-w64-mingw32-gcc-win32)
set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++-win32)
set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_C_FLAGS "-m32 -march=i386")
set(CMAKE_CXX_FLAGS "-m32 -march=i386")
1 change: 0 additions & 1 deletion toolchains/windows-x86_64.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc-win32)
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++-win32)
set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_C_FLAGS "-m64")
set(CMAKE_CXX_FLAGS "-m64")

0 comments on commit 69ec35e

Please sign in to comment.