PengZheng commented on code in PR #388: URL: https://github.com/apache/celix/pull/388#discussion_r1044307886
########## documents/cmake_commands/README.md: ########## @@ -423,155 +571,104 @@ celix_container_runtime_properties(<celix_container_target_name> ) ``` +# Celix CMake commands for generic CMake targets +Celix provides several CMake commands that operate on the generic CMake targets (executable, shared library, etc). +Celix CMake commands for generic CMake target will always use the keyword signature (`PRIVATE`, `PUBLIC`, `INTERFACE`) +version for linking, adding sources, etc. This means that these command will not work on targets created with +an "all-plain" CMake version command. +## add_celix_bundle_dependencies +Add bundles as dependencies to a cmake target, so that the bundle zip files will be created before the cmake target. +```CMake +add_celix_bundle_dependencies(<cmake_target> + bundles... +) +``` +```CMake +add_celix_bundle_dependencies(my_exec my_bundle1 my_bundle2) +``` +## celix_target_embedded_bundle +Embeds a Celix bundle into a CMake target. +```CMake +celix_target_embedded_bundle(<cmake_target> + BUNDLE <bundle> + [NAME <name>] + ) +``` +Example: +```CMake +celix_target_embedded_bundle(my_executable + BUNDLE Celix::shell + NAME celix_shell + ) +# result in the symbols: +# - celix_embedded_bundle_celix_shell_start +# - celix_embedded_bundle_celix_shell_end +# - celix_embedded_bundles = "embedded://celix_shell" +# to be added to `my_executable` +``` -# Celix Docker Images -The `add_celix_docker` Apache Celix CMake command can be used to create Apache Celix docker directories. -These directories can be used (with 'docker build' or podman) to create very small Apache Celix docker images. - -## add_celix_docker -Adds a docker target dir, containing a all the required executables, -libraries, filesystem files and selected bundles needed to run a Apache Celix framework in a docker container. +The Celix bundle will be embedded into the CMake target between the symbols: `celix_embedded_bundle_${NAME}_start` and +`celix_embedded_bundle_${NAME}_end`. -The 'add_celix_docker' target is a executable target and can be used to link libraries which are needed in the docker image. +Also a `const char * const` symbol with the name `celix_embedded_bundles` will be added or updated containing a `,` +seperated list of embedded Celix bundle urls. The url will be: `embedded://${NAME}`. -The docker dir can be found in `<cmake_build_dir>/docker[/<group_name>]/<docker_name>`. +For Linux the linking flag `--export-dynamic` is added to ensure that the previous mentioned symbols can be retrieved Review Comment: `--export-dynamic` will cause all symbols to be added to the symbol talbe, which makes `--gc-sections` linker option useless. What about `--dynamic-list`? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org