Skip to content

Commit

Permalink
update clipper2 (#817)
Browse files Browse the repository at this point in the history
* update clipper2

* test

* test2

* test3
  • Loading branch information
pca006132 authored May 24, 2024
1 parent 562ff02 commit d78b1e2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
7 changes: 3 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
flake = false;
};
inputs.clipper2-src = {
url = "github:AngusJohnson/Clipper2/Clipper2_1.3.0";
url = "github:AngusJohnson/Clipper2";
flake = false;
};
outputs = { self, nixpkgs, flake-utils, gtest-src, thrust-src, clipper2-src }:
Expand All @@ -22,7 +22,7 @@
config.allowUnfree = true;
};
clipper2 = pkgs.clipper2.overrideAttrs (_: _: {
version = "1.3.0";
version = "14052024";
src = clipper2-src;
});
manifold =
Expand Down
13 changes: 6 additions & 7 deletions manifoldDeps.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
include(FetchContent)
include(GNUInstallDirs)
find_package(PkgConfig QUIET)
find_package(Clipper2)
if(MANIFOLD_PAR STREQUAL "TBB")
find_package(TBB QUIET)
endif()
if (PKG_CONFIG_FOUND)
pkg_check_modules(Clipper2 Clipper2)
if (NOT Clipper2_FOUND)
pkg_check_modules(Clipper2 Clipper2)
endif()
if(MANIFOLD_PAR STREQUAL "TBB" AND NOT TBB_FOUND)
pkg_check_modules(TBB tbb)
endif()
Expand All @@ -27,17 +30,13 @@ else()
set(CLIPPER2_USINGZ "OFF" CACHE STRING "Preempt cache default of USINGZ (we only use 2d)")
FetchContent_Declare(Clipper2
GIT_REPOSITORY https://github.com/AngusJohnson/Clipper2.git
GIT_TAG Clipper2_1.3.0
GIT_TAG ff378668baae3570e9d8070aa9eb339bdd5a6aba
GIT_PROGRESS TRUE
SOURCE_SUBDIR CPP
)
FetchContent_MakeAvailable(Clipper2)
if(NOT EMSCRIPTEN)
set_target_properties(Clipper2 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES
"$<INSTALL_INTERFACE:include>$<BUILD_INTERFACE:${Clipper2_SOURCE_DIR}/Clipper2Lib/include>")
install(TARGETS Clipper2 EXPORT clipper2Targets)
install(EXPORT clipper2Targets DESTINATION ${CMAKE_INSTALL_DATADIR}/clipper2)
install(TARGETS Clipper2)
endif()
endif()

Expand Down
13 changes: 10 additions & 3 deletions src/cross_section/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ add_library(${PROJECT_NAME} OBJECT ${SOURCE_FILES})
target_include_directories(${PROJECT_NAME} PUBLIC
$<INSTALL_INTERFACE:include/${CMAKE_PROJECT_NAME}>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
target_link_libraries(${PROJECT_NAME}
PUBLIC utilities
PRIVATE Clipper2)

if(TARGET Clipper2::Clipper2)
target_link_libraries(${PROJECT_NAME}
PUBLIC utilities
PRIVATE Clipper2::Clipper2)
else()
target_link_libraries(${PROJECT_NAME}
PUBLIC utilities
PRIVATE Clipper2)
endif()

target_compile_options(${PROJECT_NAME} PRIVATE ${MANIFOLD_FLAGS})
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)
Expand Down

0 comments on commit d78b1e2

Please sign in to comment.