Skip to content

Commit 7545059

Browse files
committed
separate out sdk_info for easier access in C++
1 parent f28a58e commit 7545059

File tree

4 files changed

+25
-14
lines changed

4 files changed

+25
-14
lines changed

rerun_cpp/src/rerun/c/rerun.h

+1-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rerun_cpp/src/rerun/c/sdk_info.h

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/// Returns the version of the Rerun C SDK.
2+
///
3+
/// This should match the string returned by `rr_version_string` (C) or `rerun::version_string` (C++).
4+
/// If not, the SDK's binary and the C header are out of sync.
5+
#define RERUN_SDK_HEADER_VERSION "0.18.0-alpha.1"
6+
7+
/// Major version of the Rerun C SDK.
8+
#define RERUN_SDK_HEADER_VERSION_MAJOR 0
9+
10+
/// Minor version of the Rerun C SDK.
11+
#define RERUN_SDK_HEADER_VERSION_MINOR 18
12+
13+
/// Patch version of the Rerun C SDK.
14+
#define RERUN_SDK_HEADER_VERSION_PATCH 0

rerun_cpp/src/rerun/sdk_info.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
// General information about the SDK.
22
#pragma once
33

4+
#include "c/sdk_info.h"
45
#include "error.hpp"
56

67
namespace rerun {
7-
/// The Rerun C++ SDK version as a human-readable string.
8+
/// Returns a human-readable version string of the Rerun C SDK.
9+
///
10+
/// This should match the string in `RERUN_SDK_HEADER_VERSION`.
11+
/// If not, the SDK's binary and the C++ headers are out of sync.
812
const char* version_string();
913

1014
/// Internal check whether the version reported by the rerun_c binary matches `sdk_version_string`.

scripts/ci/update_rerun_py_and_c_version.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
- Python
88
- `rerun.__version__`
99
- `rerun.__version_info__`
10-
- C
10+
- C/C++
1111
- `#define RERUN_SDK_HEADER_VERSION`
12-
- `#define RERUN_SDK_HEADER_VERSION_INFO`
12+
- `#define RERUN_SDK_HEADER_VERSION_MAJOR`
13+
- `#define RERUN_SDK_HEADER_VERSION_MINOR`
14+
- `#define RERUN_SDK_HEADER_VERSION_PATCH`
1315
"""
1416

1517
from __future__ import annotations
@@ -107,7 +109,7 @@ def main() -> None:
107109

108110
sem_version = semver.VersionInfo.parse(args.VERSION)
109111
set_rerun_py_version(project_path / "rerun_py" / "rerun_sdk" / "rerun" / "__init__.py", sem_version)
110-
set_rerun_c_version(project_path / "rerun_cpp" / "src" / "rerun" / "c" / "rerun.h", sem_version)
112+
set_rerun_c_version(project_path / "rerun_cpp" / "src" / "rerun" / "c" / "sdk_info.h", sem_version)
111113

112114

113115
if __name__ == "__main__":

0 commit comments

Comments
 (0)