1 2 if(DynamoRIO_DIR AND DrMemoryFramework_DIR) 3 set(CMAKE_COMPILER_IS_GNUCC 1) 4 find_package(DynamoRIO) 5 find_package(DrMemoryFramework) 6 7 set(arch "x86_64") 8 add_library(clang_rt.msandr-${arch} SHARED msandr.cc) 9 configure_DynamoRIO_client(clang_rt.msandr-${arch}) 10 11 function(append_target_cflags tgt cflags) 12 get_property(old_cflags TARGET clang_rt.msandr-${arch} PROPERTY COMPILE_FLAGS) 13 set_property(TARGET clang_rt.msandr-${arch} PROPERTY COMPILE_FLAGS "${old_cflags} ${cflags}") 14 endfunction(append_target_cflags) 15 16 append_target_cflags(clang_rt.msandr-${arch} "-Wno-c++11-extensions") 17 18 use_DynamoRIO_extension(clang_rt.msandr-${arch} drutil) 19 use_DynamoRIO_extension(clang_rt.msandr-${arch} drmgr) 20 use_DynamoRIO_extension(clang_rt.msandr-${arch} drsyscall) 21 22 set_target_properties(clang_rt.msandr-${arch} PROPERTIES 23 LIBRARY_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) 24 install(TARGETS clang_rt.msandr-${arch} 25 LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) 26 endif() 27