Skip to content

cmake: Do not propagate compilation options to the main project#357

Open
arnopo wants to merge 3 commits intoOpenAMP:mainfrom
arnopo:fix_cmake
Open

cmake: Do not propagate compilation options to the main project#357
arnopo wants to merge 3 commits intoOpenAMP:mainfrom
arnopo:fix_cmake

Conversation

@arnopo
Copy link
Copy Markdown
Contributor

@arnopo arnopo commented Mar 19, 2026

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")

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>
@arnopo arnopo requested review from edmooring and tnmysh March 19, 2026 16:43
@arnopo
Copy link
Copy Markdown
Contributor Author

arnopo commented Mar 19, 2026

@kernelchuk could you have a look please

Copy link
Copy Markdown
Collaborator

@tnmysh tnmysh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@arnopo
Copy link
Copy Markdown
Contributor Author

arnopo commented Mar 20, 2026

Update generate some issue for zephyr. this PR needs more analysis

@arnopo arnopo marked this pull request as draft March 20, 2026 08:32
arnopo added 2 commits March 20, 2026 15:37
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>
@arnopo arnopo marked this pull request as ready for review March 20, 2026 14:38
@arnopo arnopo requested a review from tnmysh March 23, 2026 08:57
Copy link
Copy Markdown
Collaborator

@tnmysh tnmysh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants