build: wamrc: Check -mindirect-branch-register compiler option support
@@ -74,10 +74,13 @@ if (NOT MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wformat -Wformat-security")
if (WAMR_BUILD_TARGET MATCHES "X86_.*" OR WAMR_BUILD_TARGET STREQUAL "AMD_64")
if (NOT (CMAKE_C_COMPILER MATCHES ".*clang.*" OR CMAKE_C_COMPILER_ID MATCHES ".*Clang"))
+ check_c_compiler_flag(-mindirect-branch-register FLB_WAMRC_INDIRECT_BRANCH_REGISTER_SUPPORTED)
+ if (FLB_WAMRC_INDIRECT_BRANCH_REGISTER_SUPPORTE)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mindirect-branch-register")
endif ()
endif ()
endif ()
+endif ()
# Searching homebrewed LLVM automatically on macOS.
if(FLB_SYSTEM_MACOS)
