[compiler-rt] r316286 - [Compiler-rt][MIPS] Fix cross build for XRAY.
Nitesh Jain via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 22 02:37:50 PDT 2017
Author: nitesh.jain
Date: Sun Oct 22 02:37:50 2017
New Revision: 316286
URL: http://llvm.org/viewvc/llvm-project?rev=316286&view=rev
Log:
[Compiler-rt][MIPS] Fix cross build for XRAY.
Reviewers: dberris, sdardis
Subscribers: jaydeep, bhushan, llvm-commits
Differential Revision: https://reviews.llvm.org/D38021
Modified:
compiler-rt/trunk/lib/xray/CMakeLists.txt
Modified: compiler-rt/trunk/lib/xray/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/xray/CMakeLists.txt?rev=316286&r1=316285&r2=316286&view=diff
==============================================================================
--- compiler-rt/trunk/lib/xray/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/xray/CMakeLists.txt Sun Oct 22 02:37:50 2017
@@ -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)
More information about the llvm-commits
mailing list