-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve rerun_cpp readme & CMakeLists.txt #4126
Merged
+280
−208
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c345bc0
improved C++ readme
Wumpf b2be364
include everything except tests in rerun_cpp_sdk.zip
Wumpf ad1aae6
sdk bundle clarification in readme
Wumpf b04fb83
split rerun cmake file
Wumpf 8dce8c1
rerun_c build is now part of the cmake buildgraph and no longer done …
Wumpf 4daea3b
Merge remote-tracking branch 'origin/main' into andreas/cpp/better-re…
Wumpf e8176e4
fix cmake dependency hell
Wumpf 620036e
fix bundle & upload script
Wumpf c8beb38
python formatting
Wumpf 284a313
make all links in readme absolute
Wumpf 1604522
move rerun_c build out of rerun_cpp entirely
Wumpf 1c434d1
Fix tests not seeing libarrow
Wumpf 00d8edd
Merge remote-tracking branch 'origin/main' into andreas/cpp/better-re…
Wumpf f60d795
missing NOT
Wumpf 1f68439
fix some paths and library visibility
Wumpf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Builds rerun_c from source. | ||
|
||
# Determine Rust's librerun path. | ||
if(APPLE) | ||
set(RERUN_C_BUILD_ARTIFACT ${CMAKE_CURRENT_SOURCE_DIR}/../../target/release/librerun_c.a) | ||
elseif(UNIX) # if(LINUX) # CMake 3.25 | ||
set(RERUN_C_BUILD_ARTIFACT ${CMAKE_CURRENT_SOURCE_DIR}/../../target/release/librerun_c.a) | ||
elseif(WIN32) | ||
set(RERUN_C_BUILD_ARTIFACT ${CMAKE_CURRENT_SOURCE_DIR}/../../target/release/rerun_c.lib) | ||
else() | ||
message(FATAL_ERROR "Unsupported platform.") | ||
endif() | ||
|
||
# Setup rerun_c library | ||
add_library(rerun_c STATIC IMPORTED GLOBAL) | ||
set_target_properties(rerun_c PROPERTIES IMPORTED_LOCATION ${RERUN_C_BUILD_ARTIFACT}) | ||
|
||
# Just depend on all rust and toml files, it's hard to know which files exactly are relevant. | ||
file(GLOB_RECURSE RERUN_C_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/../crates/*.rs" "${CMAKE_CURRENT_SOURCE_DIR}/../crates/*.toml") | ||
add_custom_command( | ||
OUTPUT ${RERUN_C_BUILD_ARTIFACT} | ||
DEPENDS ${RERUN_C_SOURCES} | ||
COMMAND cargo build --release -p rerun_c | ||
COMMENT "Building rerun_c from source" | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../.. | ||
) | ||
|
||
# In CMake you can't depend on an output file directly. We have to wrap this in a target that rerun_c then depends on. | ||
add_custom_target(rerun_c_build DEPENDS "${RERUN_C_BUILD_ARTIFACT}") | ||
add_dependencies(rerun_c rerun_c_build) | ||
|
||
# Put `rerun.h` into the same place where it's on a user's machine and apply CMake variables like version number. | ||
configure_file( | ||
"${CMAKE_CURRENT_SOURCE_DIR}/src/rerun.h" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../../rerun_cpp/src/rerun/c/rerun.h" | ||
NEWLINE_STYLE LF # Specify line endings, otherwise CMake wants to change them on Windows. | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this expose the variables necessary to implement https://github.com/kyle-figure/bazel-minimal-rerun/blob/main/third_party/rerun/patches/cmake.patch ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tbh I'm deeply confused (and troubled) about the visibility scope of cmake variables, so I don't know. Worst case this requires more patches then