diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0abdf27..88cad5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,6 @@ name: CI on: - push: - branches: ["**"] pull_request: workflow_dispatch: @@ -69,14 +67,6 @@ jobs: restore-keys: | ${{ runner.os }}-cargo- - - name: Validate required submodules exist - shell: bash - run: | - set -euo pipefail - test -f siderust-ffi/Cargo.toml - test -f siderust-ffi/siderust/dev-deps/tempoch/tempoch-ffi/Cargo.toml - test -f qtty-cpp/CMakeLists.txt - - name: Configure (CMake) shell: bash run: | @@ -93,7 +83,7 @@ jobs: shell: bash run: | set -euo pipefail - ctest --test-dir build --output-on-failure + ctest --test-dir build --output-on-failure -L siderust_cpp - name: Build docs (Doxygen) shell: bash diff --git a/.gitignore b/.gitignore index fe8e720..5ade5e6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ cmake-build-*/ out/ build-make/ build-verify/ +build-ci-config-check/ # IDE files .vscode/ diff --git a/.gitmodules b/.gitmodules index cc58636..b0aa42e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ -[submodule "siderust-ffi"] - path = siderust-ffi - url = git@github.com:Siderust/siderust-ffi.git [submodule "qtty-cpp"] path = qtty-cpp url = git@github.com:VPRamon/qtty-cpp.git [submodule "tempoch-cpp"] path = tempoch-cpp url = git@github.com:Siderust/tempoch-cpp.git +[submodule "siderust"] + path = siderust + url = git@github.com:Siderust/siderust.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b1d2ef..751413a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,9 +10,9 @@ option(SIDERUST_BUILD_DOCS "Enable Doxygen documentation target." ON) find_program(CARGO_BIN cargo REQUIRED) # --------------------------------------------------------------------------- -# Paths to siderust-ffi +# Paths to siderust-ffi (inside the siderust submodule) # --------------------------------------------------------------------------- -set(SIDERUST_FFI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/siderust-ffi) +set(SIDERUST_FFI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/siderust/siderust-ffi) set(SIDERUST_FFI_INCLUDE_DIR ${SIDERUST_FFI_DIR}/include) @@ -29,7 +29,7 @@ endif() # --------------------------------------------------------------------------- # Platform-specific library paths # --------------------------------------------------------------------------- -set(SIDERUST_ARTIFACT_DIR ${SIDERUST_FFI_DIR}/target/release) +set(SIDERUST_ARTIFACT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/siderust/target/release) if(APPLE) set(SIDERUST_LIBRARY_PATH ${SIDERUST_ARTIFACT_DIR}/libsiderust_ffi.dylib) @@ -115,9 +115,9 @@ endif() # RPATH for shared library lookup at runtime if(APPLE) - set(_siderust_rpath "@loader_path/../siderust-ffi/target/release;@loader_path/../tempoch-cpp/tempoch/tempoch-ffi/target/release;@loader_path/../qtty-cpp/qtty/target/release") + set(_siderust_rpath "@loader_path/../siderust/target/release;@loader_path/../tempoch-cpp/tempoch/tempoch-ffi/target/release;@loader_path/../qtty-cpp/qtty/target/release") elseif(UNIX) - set(_siderust_rpath "$ORIGIN/../siderust-ffi/target/release:$ORIGIN/../tempoch-cpp/tempoch/tempoch-ffi/target/release:$ORIGIN/../qtty-cpp/qtty/target/release") + set(_siderust_rpath "$ORIGIN/../siderust/target/release:$ORIGIN/../tempoch-cpp/tempoch/tempoch-ffi/target/release:$ORIGIN/../qtty-cpp/qtty/target/release") endif() # --------------------------------------------------------------------------- @@ -137,10 +137,10 @@ enable_testing() # --------------------------------------------------------------------------- # Example # --------------------------------------------------------------------------- -add_executable(demo examples/demo.cpp) -target_link_libraries(demo PRIVATE siderust_cpp) +add_executable(siderust_demo examples/demo.cpp) +target_link_libraries(siderust_demo PRIVATE siderust_cpp) if(DEFINED _siderust_rpath) - set_target_properties(demo PROPERTIES + set_target_properties(siderust_demo PROPERTIES BUILD_RPATH ${_siderust_rpath} INSTALL_RPATH ${_siderust_rpath} ) @@ -205,7 +205,9 @@ if(DEFINED _siderust_rpath) endif() include(GoogleTest) -gtest_discover_tests(test_siderust) +gtest_discover_tests(test_siderust + PROPERTIES LABELS "siderust_cpp" +) # --------------------------------------------------------------------------- # Installation diff --git a/Dockerfile b/Dockerfile index eda0374..195f524 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,8 +25,8 @@ WORKDIR /workspace COPY . /workspace # Fail early if required submodules are missing from the build context. -RUN test -f siderust-ffi/Cargo.toml && \ - test -f siderust/tempoch/tempoch-ffi/Cargo.toml && \ +RUN test -f siderust/siderust-ffi/Cargo.toml && \ + test -f tempoch-cpp/tempoch/tempoch-ffi/Cargo.toml && \ test -f qtty-cpp/CMakeLists.txt # Validate the container toolchain by configuring, building, testing, and generating docs. diff --git a/README.md b/README.md index 3ceb21c..d4609f6 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ cmake .. cmake --build . # Run example -./demo +./siderust_demo ./coordinates_examples ./coordinate_systems_example ./solar_system_bodies_example diff --git a/include/siderust/altitude.hpp b/include/siderust/altitude.hpp index 2d17767..58c63ca 100644 --- a/include/siderust/altitude.hpp +++ b/include/siderust/altitude.hpp @@ -88,7 +88,7 @@ inline std::vector periods_from_c(tempoch_period_mjd_t* ptr, uintptr_t c for (uintptr_t i = 0; i < count; ++i) { result.push_back(Period::from_c(ptr[i])); } - tempoch_periods_free(ptr, count); + siderust_periods_free(ptr, count); return result; } diff --git a/qtty-cpp b/qtty-cpp index f7a7ba6..953ebe1 160000 --- a/qtty-cpp +++ b/qtty-cpp @@ -1 +1 @@ -Subproject commit f7a7ba6e720f7d8c005ae5c0950aaf73771ce1cb +Subproject commit 953ebe15bcd6f1b929d4516970e5127e2e1ad953 diff --git a/siderust b/siderust new file mode 160000 index 0000000..74c9456 --- /dev/null +++ b/siderust @@ -0,0 +1 @@ +Subproject commit 74c9456db9279b13d2c88516a47a5aefcbbe6130 diff --git a/siderust-ffi b/siderust-ffi deleted file mode 160000 index f587e3f..0000000 --- a/siderust-ffi +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f587e3fcd52bdaf71e6462bc4b30b56a93aa3fa5