Clear "redundant move" warning when build LLVM (#1697)
Clear warnings like below when building LLVM JIT and wamrc: llvm-project/llvm/include/llvm/ExecutionEngine/Orc/IndirectionUtils.h:73:25: warning: redundant move in return statement [-Wredundant-move] 73 | return std::move(Err);
This commit is contained in:
parent
ff4ee4a95f
commit
cef4e74fee
@ -105,6 +105,15 @@ if (WAMR_BUILD_JIT EQUAL 1)
|
|||||||
add_definitions(${LLVM_DEFINITIONS})
|
add_definitions(${LLVM_DEFINITIONS})
|
||||||
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
|
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
|
||||||
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
|
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
|
||||||
|
|
||||||
|
# Disable -Wredundant-move when building LLVM JIT
|
||||||
|
include(CheckCXXCompilerFlag)
|
||||||
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
check_cxx_compiler_flag("-Wredundant-move" CXX_SUPPORTS_REDUNDANT_MOVE_FLAG)
|
||||||
|
if (CXX_SUPPORTS_REDUNDANT_MOVE_FLAG)
|
||||||
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-redundant-move")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
else ()
|
else ()
|
||||||
unset (LLVM_AVAILABLE_LIBS)
|
unset (LLVM_AVAILABLE_LIBS)
|
||||||
endif ()
|
endif ()
|
||||||
|
Reference in New Issue
Block a user