Commit 662b973
authored
Append to cflag and honor CMAKE_POSITION_INDEPENDENT_CODE OFF (#16074)
### Summary
With this change we append the _common_compile_options instead of
replacing it and only set -fPIC if CMAKE_POSITION_INDEPENDENT_CODE is
not set to OFF
This fixes a problem when building from other projects like ZephyrOS as
it already replaced setup _common_compile_options instead of just
appending the flags. It also and always set -fPIC independent of how
CMAKE_POSITION_INDEPENDENT_CODE was set. This was causing incompatible
build binaries when building the objects files.
### Test plan
Tested by invoking the project from ZephyrOS an look at generated build
instructions after cmake has been executed.
Signed-off-by: Zingo Andersen <Zingo.Andersen@arm.com>1 parent 8f1a4bc commit 662b973
1 file changed
+9
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
282 | | - | |
283 | | - | |
| 281 | + | |
| 282 | + | |
284 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
285 | 291 | | |
286 | 292 | | |
287 | 293 | | |
| |||
0 commit comments