cmake: Do not propagate compilation options to the main project#357
Open
arnopo wants to merge 3 commits intoOpenAMP:mainfrom
Open
cmake: Do not propagate compilation options to the main project#357arnopo wants to merge 3 commits intoOpenAMP:mainfrom
arnopo wants to merge 3 commits intoOpenAMP:mainfrom
Conversation
When libmetal is included in the main project using add_subdirectory(libmetal), using set_property(GLOBAL ...) propagates properties to the main project. This can cause build errors if warnings are treated as errors. Remove set_property(GLOBAL ...) calls from libmetal’s CMakeLists. Use only target_compile_options and target properties on libmetal’s own targets. The main project should determine its own compilation options. fix commit d077e28 ("cmake: set PROJECT_EC_FLAGS to be GLOBAL property") Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Contributor
Author
|
@kernelchuk could you have a look please |
tnmysh
approved these changes
Mar 20, 2026
Contributor
Author
|
Update generate some issue for zephyr. this PR needs more analysis |
fix build error /github/workspace/lib/system/zephyr/init.c:18:52: error: unused parameter 'params' [-Werror=unused-parameter] 18 | int metal_sys_init(const struct metal_init_params *params) Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
test/system/zephyr/main.c: In function 'metal_zephyr_allocate_memory':
test/system/zephyr/main.c:33:23: error:comparison of integer expressions
of different signedness: 'int' and 'unsigned int' [-Werror=sign-compare]
33 | for (i = 0; i < sizeof(block)/sizeof(block[0]); i++) {
| ^
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When libmetal is included in the main project using add_subdirectory(libmetal), using set_property(GLOBAL ...) propagates properties to the main project. This can cause build errors if warnings are treated as errors.
Remove set_property(GLOBAL ...) calls from libmetal’s CMakeLists. Use only target_compile_options and target properties on libmetal’s own targets. The main project should determine its own compilation options.
fix commit d077e28 ("cmake: set PROJECT_EC_FLAGS to be GLOBAL property")