Skip to content
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

Log message for linktime composition on Windows #640

Open
wants to merge 2 commits into
base: rolling
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion composition/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The process will open each library and create one instance of each “rclcpp::No
ros2 run composition dlopen_composition `ros2 pkg prefix composition`/lib/libtalker_component.so `ros2 pkg prefix composition`/lib/liblistener_component.so
```

### Linktime Composition
### Linktime Composition (not supported on Windows)

Similar to previous, this runs `linktime_composition` which **links all classes from libraries** that are registered under the **library_path** with the **linker**.

Expand Down
7 changes: 7 additions & 0 deletions composition/src/linktime_composition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ int main(int argc, char * argv[])
std::vector<std::unique_ptr<class_loader::ClassLoader>> loaders;
std::vector<rclcpp_components::NodeInstanceWrapper> node_wrappers;

// Linktime composition is not supported on Windows.
#ifdef _WIN32
RCLCPP_ERROR(logger, "Linktime composition is not supported on Windows.");
rclcpp::shutdown();
return 0;
#endif // _WIN32

std::vector<std::string> libraries = {
// all classes from libraries linked by the linker (rather then dlopen)
// are registered under the library_path ""
Expand Down