Skip to content

Commit 5a57c3b

Browse files
bjorniuppsalakartben
authored andcommitted
toolchain: x86: Broken -Os detection in ia32.cmake
Fix followup problems after laguage-correct zephyr COMPILE_OPTIONS Signed-off-by: Björn Bergman <[email protected]>
1 parent ce60dd2 commit 5a57c3b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/x86/ia32.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33

44
# Find out if we are optimizing for size
55
get_target_property(zephyr_COMPILE_OPTIONS zephyr_interface INTERFACE_COMPILE_OPTIONS)
6-
if ("-Os" IN_LIST zephyr_COMPILE_OPTIONS)
6+
#Any -Os is (or may be) wraped in $<COMPILE_LANGUAGE> guards
7+
list(FILTER zephyr_COMPILE_OPTIONS INCLUDE REGEX "-Os")
8+
list(LENGTH zephyr_COMPILE_OPTIONS have_os)
9+
if (${have_os} GREATER 0)
710
zephyr_cc_option(-mpreferred-stack-boundary=2)
811
else()
912
zephyr_compile_definitions(PERF_OPT)

0 commit comments

Comments
 (0)