Skip to content

Commit 5301c4a

Browse files
committed
Merge branch 'pr/hobu/148'
Closes #148. Had to rebase w/ changes (minor).
2 parents 55db924 + cc51bb0 commit 5301c4a

File tree

357 files changed

+21823
-40978
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

357 files changed

+21823
-40978
lines changed

.github/workflows/build.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
on:
2+
push:
3+
branches: '*'
4+
5+
jobs:
6+
base:
7+
name: CPD ${{ matrix.platform }} w/ FGT ${{ matrix.fgt }}
8+
runs-on: ${{ matrix.platform }}
9+
strategy:
10+
fail-fast: true
11+
matrix:
12+
platform: ['ubuntu-latest', 'macos-latest', 'windows-latest']
13+
fgt: ['ON', 'OFF']
14+
15+
env:
16+
PLATFORM: ${{ matrix.platform }}
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- uses: goanpeca/setup-miniconda@v1
21+
with:
22+
channels: conda-forge
23+
auto-update-conda: true
24+
25+
- uses: ilammy/msvc-dev-cmd@v1
26+
if: matrix.platform == 'windows-latest'
27+
28+
- name: Setup
29+
shell: bash -l {0}
30+
run: |
31+
conda update -n base -c defaults conda -y
32+
conda install ninja cmake ninja eigen compilers jsoncpp -y
33+
34+
- name: JSONCPP
35+
shell: bash -l {0}
36+
run: |
37+
git clone https://github.com/open-source-parsers/jsoncpp.git
38+
cd jsoncpp
39+
git checkout 1.9.3
40+
mkdir build
41+
cd build
42+
if [ "$PLATFORM" == "windows-latest" ]; then
43+
export CC=cl.exe
44+
export CXX=cl.exe
45+
fi
46+
47+
cmake .. \
48+
-G Ninja \
49+
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
50+
-DBUILD_SHARED_LIBS=ON \
51+
-DJSONCPP_WITH_CMAKE_PACKAGE=ON \
52+
-DJSONCPP_WITH_TESTS=OFF \
53+
-DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF \
54+
-DCMAKE_BUILD_TYPE=Release
55+
ninja install
56+
57+
- name: FGT
58+
shell: bash -l {0}
59+
if: matrix.fgt == 'ON'
60+
run: |
61+
git clone https://github.com/gadomski/fgt.git
62+
mkdir fgt/build
63+
cd fgt/build
64+
if [ "$PLATFORM" == "windows-latest" ]; then
65+
export CC=cl.exe
66+
export CXX=cl.exe
67+
fi
68+
cmake .. \
69+
-G Ninja \
70+
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
71+
-DWITH_TESTS=OFF \
72+
-DCMAKE_BUILD_TYPE=Release \
73+
-DBUILD_SHARED_LIBS=OFF
74+
ninja
75+
ninja install
76+
77+
- name: Configure
78+
shell: bash -l {0}
79+
run: |
80+
mkdir build; cd build;
81+
if [ "$PLATFORM" == "windows-latest" ]; then
82+
export CC=cl.exe
83+
export CXX=cl.exe
84+
fi
85+
cmake .. \
86+
-G Ninja \
87+
-DBUILD_SHARED_LIBS=ON \
88+
-DCMAKE_BUILD_TYPE=Release \
89+
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
90+
-DWITH_DOCS=OFF \
91+
-DWITH_FGT=${{ matrix.fgt }} \
92+
-DWITH_JSONCPP=OFF \
93+
-DWITH_STRICT_WARNINGS=ON \
94+
-DWITH_TESTS=ON
95+
- name: Build
96+
shell: bash -l {0}
97+
working-directory: ./build
98+
run: |
99+
ninja
100+
101+
- name: Paths
102+
shell: bash -l {0}
103+
if: matrix.platform == 'windows-latest'
104+
run: |
105+
echo "::add-path::D:/a/cpd/cpd/build/bin"
106+
echo "::add-path::D:/a/cpd/cpd/build/components/jsoncpp"
107+
108+
- name: Test
109+
shell: bash -l {0}
110+
working-directory: ./build
111+
run: |
112+
ctest
113+

CMakeLists.txt

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.1)
22
set(CPD_LANGUAGES CXX)
33
set(CPD_VERSION 0.5.1)
44
set(CPD_SOVERSION 0)
5+
set(CMAKE_CXX_STANDARD 11)
6+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
7+
58

69

710
# Policies
@@ -32,11 +35,11 @@ endif()
3235

3336

3437
# Configuration
35-
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
36-
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
37-
else()
38-
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
39-
endif()
38+
#if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
39+
# option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
40+
#else()
41+
# option(BUILD_SHARED_LIBS "Build shared libraries" ON)
42+
#endif()
4043

4144
include(CMakePackageConfigHelpers)
4245
write_basic_package_version_file("${PROJECT_BINARY_DIR}/cmake/cpd-config-version.cmake" VERSION ${CPD_VERSION} COMPATIBILITY AnyNewerVersion)
@@ -63,7 +66,7 @@ else()
6366
list(APPEND library-src src/gauss_transform_make_default.cpp)
6467
endif()
6568

66-
add_library(Library-C++ ${library-src})
69+
add_library(Library-C++ STATIC ${library-src})
6770
set_target_properties(Library-C++ PROPERTIES
6871
OUTPUT_NAME cpd
6972
VERSION ${CPD_VERSION}
@@ -75,7 +78,6 @@ target_include_directories(Library-C++
7578
$<INSTALL_INTERFACE:include>
7679
${EIGEN3_INCLUDE_DIR}
7780
)
78-
target_compile_options(Library-C++ PUBLIC -std=c++11)
7981
if(WITH_FGT)
8082
target_link_libraries(Library-C++ PUBLIC Fgt::Library-C++)
8183
target_compile_definitions(Library-C++ PUBLIC CPD_WITH_FGT)
@@ -93,7 +95,8 @@ endif()
9395
option(WITH_TESTS "Build test suite" ON)
9496
if(WITH_TESTS)
9597
enable_testing()
96-
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/googletest-release-1.8.1/googletest")
98+
set(GOOGLETEST_VERSION 1.10.0)
99+
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/googletest-release-1.10.0/googletest")
97100
add_subdirectory(tests)
98101
endif()
99102

components/jsoncpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
add_library(Jsoncpp src/jsoncpp.cpp)
1+
add_library(Jsoncpp STATIC src/jsoncpp.cpp)
22
if(${BUILD_SHARED_LIBS})
33
if(NOT TARGET jsoncpp_lib)
44
message(FATAL_ERROR "Target jsoncpp_lib is not defined, but is required because cpd is building shared libs. Make sure `BUILD_SHARED_LIBS` is enabled in your jsoncpp installation.")
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Run manually to reformat a file:
2+
# clang-format -i --style=file <file>
3+
Language: Cpp
4+
BasedOnStyle: Google

vendor/googletest-release-1.8.1/.gitignore renamed to vendor/googletest-release-1.10.0/.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ bazel-testlogs
1212
*.pyc
1313

1414
# Visual Studio files
15+
.vs
1516
*.sdf
1617
*.opensdf
1718
*.VC.opendb
@@ -34,13 +35,16 @@ googletest/m4/ltoptions.m4
3435
googletest/m4/ltsugar.m4
3536
googletest/m4/ltversion.m4
3637
googletest/m4/lt~obsolete.m4
38+
googlemock/m4
3739

3840
# Ignore generated directories.
3941
googlemock/fused-src/
4042
googletest/fused-src/
4143

4244
# macOS files
4345
.DS_Store
46+
googletest/.DS_Store
47+
googletest/xcode/.DS_Store
4448

4549
# Ignore cmake generated directories and files.
4650
CMakeFiles
@@ -52,3 +56,29 @@ googlemock/CTestTestfile.cmake
5256
googlemock/Makefile
5357
googlemock/cmake_install.cmake
5458
googlemock/gtest
59+
/bin
60+
/googlemock/gmock.dir
61+
/googlemock/gmock_main.dir
62+
/googlemock/RUN_TESTS.vcxproj.filters
63+
/googlemock/RUN_TESTS.vcxproj
64+
/googlemock/INSTALL.vcxproj.filters
65+
/googlemock/INSTALL.vcxproj
66+
/googlemock/gmock_main.vcxproj.filters
67+
/googlemock/gmock_main.vcxproj
68+
/googlemock/gmock.vcxproj.filters
69+
/googlemock/gmock.vcxproj
70+
/googlemock/gmock.sln
71+
/googlemock/ALL_BUILD.vcxproj.filters
72+
/googlemock/ALL_BUILD.vcxproj
73+
/lib
74+
/Win32
75+
/ZERO_CHECK.vcxproj.filters
76+
/ZERO_CHECK.vcxproj
77+
/RUN_TESTS.vcxproj.filters
78+
/RUN_TESTS.vcxproj
79+
/INSTALL.vcxproj.filters
80+
/INSTALL.vcxproj
81+
/googletest-distribution.sln
82+
/CMakeCache.txt
83+
/ALL_BUILD.vcxproj.filters
84+
/ALL_BUILD.vcxproj

vendor/googletest-release-1.8.1/.travis.yml renamed to vendor/googletest-release-1.10.0/.travis.yml

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,56 +3,41 @@
33
# This file can be validated on:
44
# http://lint.travis-ci.org/
55

6-
sudo: false
76
language: cpp
87

98
# Define the matrix explicitly, manually expanding the combinations of (os, compiler, env).
109
# It is more tedious, but grants us far more flexibility.
1110
matrix:
1211
include:
1312
- os: linux
13+
before_install: chmod -R +x ./ci/*platformio.sh
14+
install: ./ci/install-platformio.sh
15+
script: ./ci/build-platformio.sh
16+
- os: linux
17+
dist: xenial
1418
compiler: gcc
15-
sudo : true
1619
install: ./ci/install-linux.sh && ./ci/log-config.sh
1720
script: ./ci/build-linux-bazel.sh
1821
- os: linux
22+
dist: xenial
1923
compiler: clang
20-
sudo : true
2124
install: ./ci/install-linux.sh && ./ci/log-config.sh
2225
script: ./ci/build-linux-bazel.sh
2326
- os: linux
24-
group: deprecated-2017Q4
25-
compiler: gcc
26-
install: ./ci/install-linux.sh && ./ci/log-config.sh
27-
script: ./ci/build-linux-autotools.sh
28-
- os: linux
29-
group: deprecated-2017Q4
3027
compiler: gcc
3128
env: BUILD_TYPE=Debug VERBOSE=1 CXX_FLAGS=-std=c++11
3229
- os: linux
33-
group: deprecated-2017Q4
34-
compiler: clang
35-
env: BUILD_TYPE=Debug VERBOSE=1
36-
- os: linux
37-
group: deprecated-2017Q4
3830
compiler: clang
39-
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11
31+
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11 -Wgnu-zero-variadic-macro-arguments
4032
- os: linux
4133
compiler: clang
4234
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11 NO_EXCEPTION=ON NO_RTTI=ON COMPILER_IS_GNUCXX=ON
4335
- os: osx
4436
compiler: gcc
45-
env: BUILD_TYPE=Debug VERBOSE=1
46-
- os: osx
47-
compiler: gcc
48-
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11
37+
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11 HOMEBREW_LOGS=~/homebrew-logs HOMEBREW_TEMP=~/homebrew-temp
4938
- os: osx
5039
compiler: clang
51-
env: BUILD_TYPE=Debug VERBOSE=1
52-
if: type != pull_request
53-
- os: osx
54-
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11
55-
if: type != pull_request
40+
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11 HOMEBREW_LOGS=~/homebrew-logs HOMEBREW_TEMP=~/homebrew-temp
5641

5742
# These are the install and build (script) phases for the most common entries in the matrix. They could be included
5843
# in each entry in the matrix, but that is just repetitive.
@@ -63,7 +48,7 @@ install:
6348

6449
script: ./ci/travis.sh
6550

66-
# For sudo=false builds this section installs the necessary dependencies.
51+
# This section installs the necessary dependencies.
6752
addons:
6853
apt:
6954
# List of whitelisted in travis packages for ubuntu-precise can be found here:
@@ -76,6 +61,13 @@ addons:
7661
packages:
7762
- g++-4.9
7863
- clang-3.9
64+
update: true
65+
homebrew:
66+
packages:
67+
- ccache
68+
- gcc@4.9
69+
- llvm@4
70+
update: true
7971

8072
notifications:
8173
email: false

0 commit comments

Comments
 (0)