Skip to content

Commit

Permalink
reorder CMakeLists, update ci/cd versions
Browse files Browse the repository at this point in the history
  • Loading branch information
pantor committed Jul 25, 2024
1 parent dae8283 commit 96d452a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BEFORE_ALL: git clone --depth 1 --branch v2.12.0 https://github.com/pybind/pybind11.git
CIBW_BEFORE_ALL: git clone --depth 1 --branch v2.13.1 https://github.com/pybind/pybind11.git
CIBW_SKIP: pp* # Skip PyPy
MACOSX_DEPLOYMENT_TARGET: "10.14"

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
cmake_flags: ["", " -DBUILD_CLOUD_CLIENT=OFF "]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Get cross-platform /dev/null for hidden output
run: echo "HIDDEN=$(python3 -c "import os; print(os.devnull)")" >> $GITHUB_ENV

- name: Install pybind11
run: git clone --depth 1 --branch v2.12.0 https://github.com/pybind/pybind11.git
run: git clone --depth 1 --branch v2.13.1 https://github.com/pybind/pybind11.git

- name: Install valgrind
if: matrix.os == 'ubuntu-latest'
Expand Down Expand Up @@ -67,9 +67,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Lint Python
run: |
python3 -m pip install ruff
ruff examples test
ruff check examples test --preview
69 changes: 33 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ add_library(ruckig
src/ruckig/velocity_third_step1.cpp
src/ruckig/velocity_third_step2.cpp
)
add_library(ruckig::ruckig ALIAS ruckig)

target_compile_features(ruckig PUBLIC cxx_std_17)
target_include_directories(ruckig PUBLIC
Expand All @@ -45,7 +44,6 @@ if(MSVC)
target_compile_definitions(ruckig PUBLIC _USE_MATH_DEFINES)
endif()


if(BUILD_CLOUD_CLIENT)
target_sources(ruckig PRIVATE src/ruckig/cloud_client.cpp)
target_include_directories(ruckig PUBLIC
Expand All @@ -55,6 +53,39 @@ if(BUILD_CLOUD_CLIENT)
target_compile_definitions(ruckig PUBLIC WITH_CLOUD_CLIENT)
endif()

add_library(ruckig::ruckig ALIAS ruckig)


if(BUILD_TESTS)
enable_testing()

add_library(test-dependencies INTERFACE)
target_link_libraries(test-dependencies INTERFACE ruckig)
target_include_directories(test-dependencies INTERFACE third_party)
if(MSVC)
target_compile_options(test-dependencies INTERFACE /W4)
else()
target_compile_options(test-dependencies INTERFACE -Wall -Wextra)
endif()

add_executable(test-target test/test_target.cpp)
target_link_libraries(test-target PRIVATE test-dependencies)
add_test(NAME test-target COMMAND test-target)
if(NOT MSVC)
include(CTest)
find_program(MEMORYCHECK_COMMAND valgrind)
set(MEMORYCHECK_COMMAND_OPTIONS "--tool=memcheck --leak-check=full --trace-children=yes \
--track-origins=yes --keep-debuginfo=yes --error-exitcode=100")
endif()
endif()


if(BUILD_BENCHMARK)
add_executable(benchmark-target test/benchmark_target.cpp)

target_link_libraries(benchmark-target PRIVATE ruckig)
endif()


if(BUILD_EXAMPLES)
set(EXAMPLES_LIST 01_position 02_position_offline 05_velocity 06_stop 07_minimum_duration 09_dynamic_dofs 12_custom_vector_type 13_custom_vector_type_dynamic_dofs)
Expand Down Expand Up @@ -138,40 +169,6 @@ install(FILES
)


if(BUILD_TESTS)
enable_testing()

add_library(test-dependencies INTERFACE)
target_link_libraries(test-dependencies INTERFACE ruckig)
target_include_directories(test-dependencies INTERFACE third_party)
if(MSVC)
target_compile_options(test-dependencies INTERFACE /W4)
else()
target_compile_options(test-dependencies INTERFACE -Wall -Wextra)
endif()

add_executable(test-target
test/test_target.cpp
)
target_link_libraries(test-target PRIVATE test-dependencies)
add_test(NAME test-target COMMAND test-target)
if(NOT MSVC)
include(CTest)
find_program(MEMORYCHECK_COMMAND valgrind)
set(MEMORYCHECK_COMMAND_OPTIONS "--tool=memcheck --leak-check=full --trace-children=yes \
--track-origins=yes --keep-debuginfo=yes --error-exitcode=100")
endif()

endif()


if(BUILD_BENCHMARK)
add_executable(benchmark-target test/benchmark_target.cpp)

target_link_libraries(benchmark-target PRIVATE ruckig)
endif()


# Enable Packaging
set(CPACK_PACKAGE_VENDOR "Lars Berscheid")
set(CPACK_GENERATOR "DEB")
Expand Down

0 comments on commit 96d452a

Please sign in to comment.