Skip to content

Commit

Permalink
Merge branch 'pr/hobu/148'
Browse files Browse the repository at this point in the history
Closes #148. Had to rebase w/ changes (minor).
  • Loading branch information
gadomski committed Nov 10, 2020
2 parents 55db924 cc51bb0 commit 5301c4a
Show file tree
Hide file tree
Showing 357 changed files with 21,823 additions and 40,978 deletions.
113 changes: 113 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 1,113 @@
on:
push:
branches: '*'

jobs:
base:
name: CPD ${{ matrix.platform }} w/ FGT ${{ matrix.fgt }}
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: true
matrix:
platform: ['ubuntu-latest', 'macos-latest', 'windows-latest']
fgt: ['ON', 'OFF']

env:
PLATFORM: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v2
- uses: goanpeca/setup-miniconda@v1
with:
channels: conda-forge
auto-update-conda: true

- uses: ilammy/msvc-dev-cmd@v1
if: matrix.platform == 'windows-latest'

- name: Setup
shell: bash -l {0}
run: |
conda update -n base -c defaults conda -y
conda install ninja cmake ninja eigen compilers jsoncpp -y
- name: JSONCPP
shell: bash -l {0}
run: |
git clone https://github.com/open-source-parsers/jsoncpp.git
cd jsoncpp
git checkout 1.9.3
mkdir build
cd build
if [ "$PLATFORM" == "windows-latest" ]; then
export CC=cl.exe
export CXX=cl.exe
fi
cmake .. \
-G Ninja \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DBUILD_SHARED_LIBS=ON \
-DJSONCPP_WITH_CMAKE_PACKAGE=ON \
-DJSONCPP_WITH_TESTS=OFF \
-DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF \
-DCMAKE_BUILD_TYPE=Release
ninja install
- name: FGT
shell: bash -l {0}
if: matrix.fgt == 'ON'
run: |
git clone https://github.com/gadomski/fgt.git
mkdir fgt/build
cd fgt/build
if [ "$PLATFORM" == "windows-latest" ]; then
export CC=cl.exe
export CXX=cl.exe
fi
cmake .. \
-G Ninja \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DWITH_TESTS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF
ninja
ninja install
- name: Configure
shell: bash -l {0}
run: |
mkdir build; cd build;
if [ "$PLATFORM" == "windows-latest" ]; then
export CC=cl.exe
export CXX=cl.exe
fi
cmake .. \
-G Ninja \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DWITH_DOCS=OFF \
-DWITH_FGT=${{ matrix.fgt }} \
-DWITH_JSONCPP=OFF \
-DWITH_STRICT_WARNINGS=ON \
-DWITH_TESTS=ON
- name: Build
shell: bash -l {0}
working-directory: ./build
run: |
ninja
- name: Paths
shell: bash -l {0}
if: matrix.platform == 'windows-latest'
run: |
echo "::add-path::D:/a/cpd/cpd/build/bin"
echo "::add-path::D:/a/cpd/cpd/build/components/jsoncpp"
- name: Test
shell: bash -l {0}
working-directory: ./build
run: |
ctest
19 changes: 11 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 2,9 @@ cmake_minimum_required(VERSION 3.1)
set(CPD_LANGUAGES CXX)
set(CPD_VERSION 0.5.1)
set(CPD_SOVERSION 0)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)



# Policies
Expand Down Expand Up @@ -32,11 35,11 @@ endif()


# Configuration
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
else()
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
endif()
#if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
#else()
# option(BUILD_SHARED_LIBS "Build shared libraries" ON)
#endif()

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

add_library(Library-C ${library-src})
add_library(Library-C STATIC ${library-src})
set_target_properties(Library-C PROPERTIES
OUTPUT_NAME cpd
VERSION ${CPD_VERSION}
Expand All @@ -75,7 78,6 @@ target_include_directories(Library-C
$<INSTALL_INTERFACE:include>
${EIGEN3_INCLUDE_DIR}
)
target_compile_options(Library-C PUBLIC -std=c 11)
if(WITH_FGT)
target_link_libraries(Library-C PUBLIC Fgt::Library-C )
target_compile_definitions(Library-C PUBLIC CPD_WITH_FGT)
Expand All @@ -93,7 95,8 @@ endif()
option(WITH_TESTS "Build test suite" ON)
if(WITH_TESTS)
enable_testing()
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/googletest-release-1.8.1/googletest")
set(GOOGLETEST_VERSION 1.10.0)
add_subdirectory("${PROJECT_SOURCE_DIR}/vendor/googletest-release-1.10.0/googletest")
add_subdirectory(tests)
endif()

Expand Down
2 changes: 1 addition & 1 deletion components/jsoncpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 1,4 @@
add_library(Jsoncpp src/jsoncpp.cpp)
add_library(Jsoncpp STATIC src/jsoncpp.cpp)
if(${BUILD_SHARED_LIBS})
if(NOT TARGET jsoncpp_lib)
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.")
Expand Down
4 changes: 4 additions & 0 deletions vendor/googletest-release-1.10.0/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 1,4 @@
# Run manually to reformat a file:
# clang-format -i --style=file <file>
Language: Cpp
BasedOnStyle: Google
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 12,7 @@ bazel-testlogs
*.pyc

# Visual Studio files
.vs
*.sdf
*.opensdf
*.VC.opendb
Expand All @@ -34,13 35,16 @@ googletest/m4/ltoptions.m4
googletest/m4/ltsugar.m4
googletest/m4/ltversion.m4
googletest/m4/lt~obsolete.m4
googlemock/m4

# Ignore generated directories.
googlemock/fused-src/
googletest/fused-src/

# macOS files
.DS_Store
googletest/.DS_Store
googletest/xcode/.DS_Store

# Ignore cmake generated directories and files.
CMakeFiles
Expand All @@ -52,3 56,29 @@ googlemock/CTestTestfile.cmake
googlemock/Makefile
googlemock/cmake_install.cmake
googlemock/gtest
/bin
/googlemock/gmock.dir
/googlemock/gmock_main.dir
/googlemock/RUN_TESTS.vcxproj.filters
/googlemock/RUN_TESTS.vcxproj
/googlemock/INSTALL.vcxproj.filters
/googlemock/INSTALL.vcxproj
/googlemock/gmock_main.vcxproj.filters
/googlemock/gmock_main.vcxproj
/googlemock/gmock.vcxproj.filters
/googlemock/gmock.vcxproj
/googlemock/gmock.sln
/googlemock/ALL_BUILD.vcxproj.filters
/googlemock/ALL_BUILD.vcxproj
/lib
/Win32
/ZERO_CHECK.vcxproj.filters
/ZERO_CHECK.vcxproj
/RUN_TESTS.vcxproj.filters
/RUN_TESTS.vcxproj
/INSTALL.vcxproj.filters
/INSTALL.vcxproj
/googletest-distribution.sln
/CMakeCache.txt
/ALL_BUILD.vcxproj.filters
/ALL_BUILD.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 3,41 @@
# This file can be validated on:
# http://lint.travis-ci.org/

sudo: false
language: cpp

# Define the matrix explicitly, manually expanding the combinations of (os, compiler, env).
# It is more tedious, but grants us far more flexibility.
matrix:
include:
- os: linux
before_install: chmod -R x ./ci/*platformio.sh
install: ./ci/install-platformio.sh
script: ./ci/build-platformio.sh
- os: linux
dist: xenial
compiler: gcc
sudo : true
install: ./ci/install-linux.sh && ./ci/log-config.sh
script: ./ci/build-linux-bazel.sh
- os: linux
dist: xenial
compiler: clang
sudo : true
install: ./ci/install-linux.sh && ./ci/log-config.sh
script: ./ci/build-linux-bazel.sh
- os: linux
group: deprecated-2017Q4
compiler: gcc
install: ./ci/install-linux.sh && ./ci/log-config.sh
script: ./ci/build-linux-autotools.sh
- os: linux
group: deprecated-2017Q4
compiler: gcc
env: BUILD_TYPE=Debug VERBOSE=1 CXX_FLAGS=-std=c 11
- os: linux
group: deprecated-2017Q4
compiler: clang
env: BUILD_TYPE=Debug VERBOSE=1
- os: linux
group: deprecated-2017Q4
compiler: clang
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c 11
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c 11 -Wgnu-zero-variadic-macro-arguments
- os: linux
compiler: clang
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c 11 NO_EXCEPTION=ON NO_RTTI=ON COMPILER_IS_GNUCXX=ON
- os: osx
compiler: gcc
env: BUILD_TYPE=Debug VERBOSE=1
- os: osx
compiler: gcc
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c 11
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c 11 HOMEBREW_LOGS=~/homebrew-logs HOMEBREW_TEMP=~/homebrew-temp
- os: osx
compiler: clang
env: BUILD_TYPE=Debug VERBOSE=1
if: type != pull_request
- os: osx
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c 11
if: type != pull_request
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c 11 HOMEBREW_LOGS=~/homebrew-logs HOMEBREW_TEMP=~/homebrew-temp

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

script: ./ci/travis.sh

# For sudo=false builds this section installs the necessary dependencies.
# This section installs the necessary dependencies.
addons:
apt:
# List of whitelisted in travis packages for ubuntu-precise can be found here:
Expand All @@ -76,6 61,13 @@ addons:
packages:
- g -4.9
- clang-3.9
update: true
homebrew:
packages:
- ccache
- [email protected]
- llvm@4
update: true

notifications:
email: false
Loading

0 comments on commit 5301c4a

Please sign in to comment.