Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/main'
Browse files Browse the repository at this point in the history
* remotes/origin/main:
  Minor code tidy
  Added CLIPPER2_HI_PRECISION option in CMakeLists.txt
  Additional minor tweaks to cpp/benchmark tests
  Make googletest not be a git submodule, and instead clone it separately in the CI script (AngusJohnson#745)
  fix compiler warning of -Wunused-but-set-parameter with -fno-exceptions (AngusJohnson#744)
  Additional tweaks to GetIntersectPtBenchmark.cpp
  Additional GetIntersectPtBenchmark tweaks
  Fixed incorrect code comment
  Added new GetIntersectPoint benchmark test Updated other benchmark tests.
  Code formatting only (removed trailing spaces)
  Fixed minor typecasting issues (AngusJohnson#727)
  More tweaks to PointInPolygon benchmarking.
  Allow using external gtest with GTest:: qualified names (AngusJohnson#737)
  Fixed a significant (though uncommon) bug in polygon clipping (AngusJohnson#736) Fixed bugs in PointInPolygon benchmark testing.
  Minor tweaks to PointInPolygon benchmark testing.
  Fixed a minor syntax error tripping some C++ compilers
  Version 1.3.0 1. Fixed a significant offsetting bug introduced in previous update (AngusJohnson#733) 2. Fixed a C++ compile error when 32bit compiling (AngusJohnson#727) 3. Minor tweak to CMakeLists.txt (C++) (AngusJohnson#728) 4. Will now offset 'flat' polygons (Disc.AngusJohnson#725) 5. Reminder: recent change in open path offsetting behaviour (AngusJohnson#707) 6. Reminder: recent changes to clipper.export.h data structures.
  Fixed a typo and tweaked documentation
  Version 1.2.4   Changes since ver 1.2.3 include:   1. Important: Offsetting open path behaviour has changed.      The delta now behaves as it did in Clipper1 (See Issue AngusJohnson#707)   2. Important: Data structures of exported values in clipper.export.h have changed.   3. Minor bugfixes to PolyTree nesting (AngusJohnson#679, AngusJohnson#687)   4. Numerous minor bugfixes to polygon offsetting (AngusJohnson#703, AngusJohnson#715, AngusJohnson#724)   5. Fixed an obscure bug in polygon clipping caused by horizontal spikes (AngusJohnson#720)   6. Significantly improved documentation.
  Additional minor bugfix to ClipperOffset (AngusJohnson#724 & Disc.AngusJohnson#726)
  • Loading branch information
jiajuncccc committed Dec 14, 2023
2 parents e409a68 + be61c7e commit ddec95f
Show file tree
Hide file tree
Showing 40 changed files with 1,651 additions and 838 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/actions_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ jobs:
with:
node-version: '16'
- name: Get GoogleTest
run: git submodule update --init
run: |
cd CPP/Tests
git clone https://github.com/google/googletest
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
- name: Build
Expand All @@ -32,7 +34,9 @@ jobs:
with:
node-version: '16'
- name: Get GoogleTest
run: git submodule update --init
run: |
cd CPP/Tests
git clone https://github.com/google/googletest
- name: Build
run: |
mkdir CPP/build
Expand All @@ -51,7 +55,9 @@ jobs:
with:
node-version: '16'
- name: Get GoogleTest
run: git submodule update --init
run: |
cd CPP/Tests
git clone https://github.com/google/googletest
- name: Install gcc 11
run: |
sudo apt update
Expand All @@ -75,7 +81,9 @@ jobs:
with:
node-version: '16'
- name: Get GoogleTest
run: git submodule update --init
run: |
cd CPP/Tests
git clone https://github.com/google/googletest
- name: Build
run: |
export CC=/usr/bin/clang
Expand All @@ -96,7 +104,9 @@ jobs:
with:
node-version: '16'
- name: Get GoogleTest
run: git submodule update --init
run: |
cd CPP/Tests
git clone https://github.com/google/googletest
- name: Install clang 13
run: |
wget https://apt.llvm.org/llvm.sh
Expand All @@ -122,7 +132,9 @@ jobs:
with:
node-version: '16'
- name: Get GoogleTest
run: git submodule update --init
run: |
cd CPP/Tests
git clone https://github.com/google/googletest
- name: Build
run: |
mkdir CPP/build
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "CPP/Tests/googletest"]
path = CPP/Tests/googletest
url = https://github.com/google/googletest
54 changes: 49 additions & 5 deletions CPP/BenchMark/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
cmake_minimum_required(VERSION 3.15)
project(Clipper2_benchmarks VERSION 1.0 LANGUAGES C CXX)

if(NOT DEFINED CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD LESS 17)
set(CMAKE_CXX_STANDARD 17)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# fetch the google benchmark library
include(FetchContent)
set(BENCHMARK_ENABLE_GTEST_TESTS OFF)
Expand All @@ -6,31 +15,66 @@ message("start fetching the googlebenchmark")
FetchContent_Declare(googlebenchmark
GIT_REPOSITORY https://github.com/google/benchmark.git
GIT_TAG v1.7.1
)
)

FetchContent_MakeAvailable(
googlebenchmark)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
message("fetching is done")

set(benchmark_srcs
GetIntersectPtBenchmark.cpp
PointInPolygonBenchmark.cpp
StripDuplicateBenchmark.cpp
# more to add
)

set(CLIPPER2_INC
${CLIPPER2_INC_FOLDER}/clipper.h
${CLIPPER2_INC_FOLDER}/clipper.version.h
${CLIPPER2_INC_FOLDER}/clipper.core.h
)

add_library(Clipper2_bm INTERFACE)
target_include_directories(Clipper2_bm INTERFACE CLIPPER2_INC)

set(CLIPPER2_UTILS_INC
../Utils/clipper.svg.h
../Utils/ClipFileLoad.h
../Utils/ClipFileSave.h
../Utils/Timer.h
../Utils/Colors.h
../Utils/CommonUtils.h
)
set(CLIPPER2_UTILS_SRC
../Utils/clipper.svg.cpp
../Utils/ClipFileLoad.cpp
../Utils/ClipFileSave.cpp
)
set(CLIPPER2_UTILS "")
list(APPEND CLIPPER2_UTILS Clipper2utils_bm)
add_library(Clipper2utils_bm STATIC ${CLIPPER2_UTILS_INC} ${CLIPPER2_UTILS_SRC})
target_include_directories(Clipper2utils_bm
PUBLIC ../Clipper2Lib/include
PUBLIC ../Utils
)
target_link_libraries(Clipper2utils_bm PUBLIC Clipper2_bm)

# add each benchmark from the benchmark_srcs
foreach(benchmark ${benchmark_srcs})
get_filename_component(benchmark_target ${benchmark} NAME_WE)

message(STATUS "${PROJECT_NAME} add benchmark ${benchmark_target}")
add_executable(${benchmark_target} ${benchmark})
target_include_directories(${benchmark_target} PUBLIC


target_include_directories(${benchmark_target}
PUBLIC ../Clipper2Lib/include
PUBLIC ../Utils
)

target_link_libraries(${benchmark_target}
benchmark::benchmark
Clipper2
Clipper2utils
Clipper2_bm
Clipper2utils_bm
)
endforeach()
Loading

0 comments on commit ddec95f

Please sign in to comment.