diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index e02520f..aa6527a 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -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 }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b77d91..6b9f46b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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" @@ -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() \ No newline at end of file + + set(CMAKE_SHARED_LIBRARY_PREFIX "") + set(CMAKE_SHARED_MODULE_PREFIX "") + set(CMAKE_STATIC_LIBRARY_PREFIX "") +endif() diff --git a/toolchains/windows-aarch64.cmake b/toolchains/windows-aarch64.cmake index bf0d2d6..aa7bfb2 100644 --- a/toolchains/windows-aarch64.cmake +++ b/toolchains/windows-aarch64.cmake @@ -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") \ No newline at end of file diff --git a/toolchains/windows-i386.cmake b/toolchains/windows-i386.cmake index ae9ed89..054afee 100644 --- a/toolchains/windows-i386.cmake +++ b/toolchains/windows-i386.cmake @@ -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") \ No newline at end of file diff --git a/toolchains/windows-x86_64.cmake b/toolchains/windows-x86_64.cmake index dea1301..a724164 100644 --- a/toolchains/windows-x86_64.cmake +++ b/toolchains/windows-x86_64.cmake @@ -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") \ No newline at end of file