From ce1758f76f5b6c12e15200b28bcfe896d54418ca Mon Sep 17 00:00:00 2001 From: Sebastian Erives Date: Mon, 7 Oct 2024 19:52:28 -0600 Subject: [PATCH] Add pthread-win32 --- .github/workflows/build_natives.yml | 6 ++---- .gitmodules | 3 +++ CMakeLists.txt | 6 ++++++ pthread-win32 | 1 + 4 files changed, 12 insertions(+), 4 deletions(-) create mode 160000 pthread-win32 diff --git a/.github/workflows/build_natives.yml b/.github/workflows/build_natives.yml index 7ca9de6..dfe459a 100644 --- a/.github/workflows/build_natives.yml +++ b/.github/workflows/build_natives.yml @@ -35,12 +35,10 @@ jobs: with: distribution: adopt java-version: "8" - - uses: cygwin/cygwin-install-action@master - name: Configure CMake - run: | - bash cd ${{github.workspace}} && cmake -T ClangCL . + run: cmake -T ClangCL . - name: Build - run: bash cmake --build ${{github.workspace}} --config ${{env.BUILD_TYPE}} + run: cmake --build ${{github.workspace}} --config ${{env.BUILD_TYPE}} - uses: actions/upload-artifact@v3 with: name: native-windows-amd64 diff --git a/.gitmodules b/.gitmodules index 1a54845..5f8bc8e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "src/main/cpp/apriltag"] path = apriltag url = https://github.com/AprilRobotics/apriltag/ +[submodule "pthread-win32"] + path = pthread-win32 + url = https://github.com/GerHobbelt/pthread-win32 diff --git a/CMakeLists.txt b/CMakeLists.txt index edbe2d0..7ee3e5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,12 @@ set(JAVA_AWT_INCLUDE_PATH NotNeeded) find_package(JNI REQUIRED) +if (WIN32) + add_subdirectory(pthread-win32/) + target_link_libraries(apriltag pthread) + target_include_directories(apriltag PRIVATE pthread-win32/) +endif() + add_library( # Specifies the name of the library. apriltag diff --git a/pthread-win32 b/pthread-win32 new file mode 160000 index 0000000..3309f4d --- /dev/null +++ b/pthread-win32 @@ -0,0 +1 @@ +Subproject commit 3309f4d6e7538f349ae450347b02132ecb0606a7