Skip to content

Commit ee58fef

Browse files
marc-hbkv2019i
authored andcommitted
smex/cmake: move -Wl,EL option to target_linker_options() for clang
-Wl,EL is a linker option, not a compiler option and clang does not like it at compilation time; it fails like this: ``` cd smex cmake -B build -DCMAKE_C_COMPILER=clang make -C build clang-15: error: -Wl,-EL: 'linker' input unused [-Werror,-Wunused-command-line-argument] ``` Reported by @andyross in google/oss-fuzz#10342 oss-fuzz does not need smex at all but this one-line fix is just faster and simpler than a bigger CMake re-architecture just for oss-fuzz. Also simplify this for clang compatibility: ``` error: unknown warning option '-Wimplicit-fallthrough=3'; did you mean '-Wimplicit-fallthrough'? [-Werror,-Wunknown-warning-option] ``` Signed-off-by: Marc Herbert <marc.herbert@intel.com>
1 parent 38f3f5d commit ee58fef

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

smex/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ add_executable(smex
1919

2020
# In addition to the usual flags from CMAKE_BUILD_TYPE
2121
target_compile_options(smex PRIVATE
22-
-Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3
22+
-Wall -Werror -Wmissing-prototypes -Wimplicit-fallthrough
23+
)
24+
25+
target_link_options(smex PRIVATE
26+
-Wall -Werror -Wl,-EL
2327
)
2428

2529
target_include_directories(smex PRIVATE

0 commit comments

Comments
 (0)