Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zephyr_library_compile_options(): silently de-duplicate
PR #14776 / commit 915a353 changed function zephyr_library_compile_options() to use MD5 instead of RANDOM for build reproduction reasons. As later predicted by Sebastian Bøe in the PR (thx), the names generated for these pseudo-libraries won't be unique anymore if the exact same flag gets added more than once. To reproduce the issue, simply add the following two lines in some CMakeLists.txt file like samples/hello_world/CMakeLists.txt: zephyr_library_compile_options("-Dfubar=barfu") zephyr_library_compile_options("-Dfubar=barfu") cmake will then fail like this: CMake Error at zephyr/cmake/extensions.cmake:403 (add_library): add_library cannot create target "options_interface_lib_e689fdb7eb15d801c2f95dd61301fc5e" because another target with the same name already exists. The existing target is an interface library created in source directory "zephyr/samples/hello_world". See documentation for policy CMP0002 for more details. Call Stack (most recent call first): CMakeLists.txt:9 (zephyr_library_compile_options) As requested by Sebastian, silently discard duplicate options just like CMake does. Fixes #15093 Signed-off-by: Marc Herbert <[email protected]>
- Loading branch information