Skip to content

Commit

Permalink
Merge pull request #68 from petiaccja/conan-update
Browse files Browse the repository at this point in the history
upgrade to conan 2, update dependencies
  • Loading branch information
petiaccja authored Jun 23, 2023
2 parents 831e52a + 86fb456 commit 8c93abb
Show file tree
Hide file tree
Showing 45 changed files with 228 additions and 1,007 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ jobs:
test_name: .\Bin\UnitTest.exe
- os: ubuntu-latest
test_name: ./Bin/UnitTest
- build_type: Debug
conan_preset: "conan-debug"
- build_type: Release
conan_preset: "conan-release"
exclude:
- os: windows-latest
c_compiler: gcc
Expand All @@ -48,8 +52,20 @@ jobs:

- name: Install conan
shell: bash
env:
CC: "${{ matrix.c_compiler != 'cl' && matrix.c_compiler || '' }}"
CXX: "${{ matrix.cxx_compiler != 'cl' && matrix.cxx_compiler || '' }}"
run: |
pip install conan
conan profile detect --name ci --force
python $GITHUB_WORKSPACE/support/update-conan-profile.py $(conan profile path ci) ${{matrix.build_type}} ${{matrix.c_compiler}} ${{matrix.cxx_compiler}} ${{matrix.cxx_standard}}
- name: Cache conan packages
id: cache-conan
uses: actions/cache@v3
with:
path: ~/.conan2/p
key: conan-cache-packages-${{ matrix.os }}-${{ matrix.c_compiler }}-${{ matrix.build_type }}-${{ matrix.cxx_standard }}

- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
Expand All @@ -60,7 +76,10 @@ jobs:
env:
CC: ${{matrix.c_compiler}}
CXX: ${{matrix.cxx_compiler}}
run: cmake $GITHUB_WORKSPACE -G Ninja -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_CXX_STANDARD=${{ matrix.cxx_standard }}
run: |
conan install $GITHUB_WORKSPACE --output-folder=. --build=missing -pr ci -pr:b ci -s build_type=${{ matrix.build_type }}
conan cache clean
cmake $GITHUB_WORKSPACE --preset ${{ matrix.conan_preset }}
- name: Build
working-directory: ${{runner.workspace}}/build
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,28 @@ jobs:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: KyleMayes/install-llvm-action@v1
with:
version: "10.0"
version: "15.0"
directory: ${{ runner.temp }}/llvm
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Install conan
shell: bash
env:
CC: clang
CXX: clang++
run: |
pip install conan
conan profile detect --name ci --force
python $GITHUB_WORKSPACE/support/update-conan-profile.py $(conan profile path ci) Debug $CC $CXX 17
- name: Cache conan packages
id: cache-conan
uses: actions/cache@v3
with:
path: ~/.conan2/p
key: conan-cache-packages-sonarqube

- name: Download and set up sonar-scanner
env:
Expand Down Expand Up @@ -59,7 +71,10 @@ jobs:
env:
CC: clang
CXX: clang++
run: cmake $GITHUB_WORKSPACE -G Ninja -DCMAKE_BUILD_TYPE=Debug -DENABLE_LLVM_COV=ON
run: |
conan install $GITHUB_WORKSPACE --output-folder=. --build=missing -pr ci -pr:b ci -s build_type=Debug
conan cache clean
cmake $GITHUB_WORKSPACE --preset conan-debug -DENABLE_LLVM_COV:BOOL=ON
- name: Run build-wrapper
run: |
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,7 @@ _Pvt_Extensions
ParameterExtraction/training/saved_networks/

*.asv

build/

CMakeUserPresets.json
19 changes: 3 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
## DSPBB CMake
project(DSPBB)
cmake_minimum_required(VERSION 3.24.0)

cmake_minimum_required(VERSION 3.15.0)
project(DSPBB)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Cpp flags
enable_language(CXX)
Expand Down Expand Up @@ -52,18 +51,6 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
link_libraries(Threads::Threads)

# Conan library dependencies
include(conan.cmake)
conan_cmake_configure(
REQUIRES
xsimd/8.0.3
eigen/3.4.0
catch2/2.13.4
GENERATORS cmake_find_package
)
conan_cmake_autodetect(conan_settings)
conan_cmake_install(PATH_OR_REFERENCE . BUILD missing SETTINGS ${conan_settings} OUTPUT_QUIET)

# Output directories
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Bin)
Expand Down
10 changes: 1 addition & 9 deletions benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,5 @@ target_sources(Benchmark
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}/benchmark)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}/benchmark)

conan_cmake_configure(
REQUIRES
celero/2.8.2
GENERATORS cmake_find_package
)
conan_cmake_install(PATH_OR_REFERENCE . BUILD missing SETTINGS ${conan_settings} OUTPUT_QUIET)


find_package(Celero REQUIRED)
target_link_libraries(Benchmark celero::celero DSPBB)
target_link_libraries(Benchmark celero DSPBB)
Loading

0 comments on commit 8c93abb

Please sign in to comment.