Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: CI

on:
push:
branches: ["**"]
pull_request:
workflow_dispatch:

Expand Down Expand Up @@ -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: |
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cmake-build-*/
out/
build-make/
build-verify/
build-ci-config-check/

# IDE files
.vscode/
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
20 changes: 11 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
Expand Down Expand Up @@ -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()

# ---------------------------------------------------------------------------
Expand All @@ -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}
)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ cmake ..
cmake --build .

# Run example
./demo
./siderust_demo
./coordinates_examples
./coordinate_systems_example
./solar_system_bodies_example
Expand Down
2 changes: 1 addition & 1 deletion include/siderust/altitude.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ inline std::vector<Period> 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;
}

Expand Down
2 changes: 1 addition & 1 deletion qtty-cpp
1 change: 1 addition & 0 deletions siderust
Submodule siderust added at 74c945
1 change: 0 additions & 1 deletion siderust-ffi
Submodule siderust-ffi deleted from f587e3