Skip to content

Commit

Permalink
Merge pull request #6 from drecom/feature/merge-upstream
Browse files Browse the repository at this point in the history
Merge upstream after 1.3.0 ~
  • Loading branch information
Egliss authored Jun 5, 2024
2 parents ec1226e + 9fc23cd commit 11ca8c4
Show file tree
Hide file tree
Showing 58 changed files with 3,068 additions and 1,890 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/actions_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Get GoogleTest
run: git submodule update --init
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Build
Expand All @@ -32,8 +30,6 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Get GoogleTest
run: git submodule update --init
- name: Build
run: |
mkdir CPP/build
Expand All @@ -51,8 +47,6 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Get GoogleTest
run: git submodule update --init
- name: Install gcc 11
run: |
sudo apt update
Expand All @@ -75,8 +69,6 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Get GoogleTest
run: git submodule update --init
- name: Build
run: |
export CC=/usr/bin/clang
Expand All @@ -96,8 +88,6 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Get GoogleTest
run: git submodule update --init
- name: Install clang 13
run: |
wget https://apt.llvm.org/llvm.sh
Expand All @@ -122,8 +112,6 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Get GoogleTest
run: git submodule update --init
- 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
39 changes: 37 additions & 2 deletions CPP/BenchMark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,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 ../Clipper2Lib/include
PUBLIC ../Utils
PUBLIC ../Utils
)

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

0 comments on commit 11ca8c4

Please sign in to comment.