From: Nitesh Jain Date: Sun, 22 Oct 2017 09:37:50 +0000 (+0000) Subject: [Compiler-rt][MIPS] Fix cross build for XRAY. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf8a5c26f92e3f4dc6a35ce92c9d4dc919beaef6;p=platform%2Fupstream%2Fllvm.git [Compiler-rt][MIPS] Fix cross build for XRAY. Reviewers: dberris, sdardis Subscribers: jaydeep, bhushan, llvm-commits Differential Revision: https://reviews.llvm.org/D38021 llvm-svn: 316286 --- diff --git a/compiler-rt/lib/xray/CMakeLists.txt b/compiler-rt/lib/xray/CMakeLists.txt index 6d24ba8..42f5ee6 100644 --- a/compiler-rt/lib/xray/CMakeLists.txt +++ b/compiler-rt/lib/xray/CMakeLists.txt @@ -60,6 +60,12 @@ include_directories(../../include) set(XRAY_CFLAGS ${SANITIZER_COMMON_CFLAGS}) set(XRAY_COMMON_DEFINITIONS XRAY_HAS_EXCEPTIONS=1) + +if (NOT MSVC AND NOT DEFINED TARGET_FLAGS) + set(TARGET_FLAGS ${CMAKE_CXX_FLAGS}) + separate_arguments(TARGET_FLAGS) +endif() + append_list_if( COMPILER_RT_HAS_XRAY_COMPILER_FLAG XRAY_SUPPORTED=1 XRAY_COMMON_DEFINITIONS) append_list_if( @@ -67,7 +73,7 @@ append_list_if( add_compiler_rt_object_libraries(RTXray ARCHS ${XRAY_SUPPORTED_ARCH} - SOURCES ${XRAY_SOURCES} CFLAGS ${XRAY_CFLAGS} + SOURCES ${XRAY_SOURCES} CFLAGS ${XRAY_CFLAGS} ${TARGET_FLAGS} DEFS ${XRAY_COMMON_DEFINITIONS}) add_compiler_rt_component(xray) @@ -82,7 +88,7 @@ foreach(arch ${XRAY_SUPPORTED_ARCH}) STATIC ARCHS ${arch} SOURCES ${${arch}_SOURCES} - CFLAGS ${XRAY_CFLAGS} + CFLAGS ${XRAY_CFLAGS} ${TARGET_FLAGS} DEFS ${XRAY_COMMON_DEFINITIONS} OBJECT_LIBS ${XRAY_COMMON_RUNTIME_OBJECT_LIBS} PARENT_TARGET xray)