Evgeniy Stepanov | 79b2d17 | 2013-02-22 09:34:19 +0000 | [diff] [blame] | 1 | |
| 2 | if(DynamoRIO_DIR AND DrMemoryFramework_DIR) |
| 3 | set(CMAKE_COMPILER_IS_GNUCC 1) |
| 4 | find_package(DynamoRIO) |
| 5 | find_package(DrMemoryFramework) |
| 6 | |
Evgeniy Stepanov | 88732a3 | 2013-10-25 14:57:02 +0000 | [diff] [blame^] | 7 | option(MSANDR_NATIVE_EXEC "Building msandr client for running in DynamoRIO hybrid mode, which allows some module running natively" OFF) |
| 8 | if (MSANDR_NATIVE_EXEC) |
| 9 | add_definitions(-DMSANDR_NATIVE_EXEC) |
| 10 | endif (MSANDR_NATIVE_EXEC) |
| 11 | |
Evgeniy Stepanov | 79b2d17 | 2013-02-22 09:34:19 +0000 | [diff] [blame] | 12 | set(arch "x86_64") |
| 13 | add_library(clang_rt.msandr-${arch} SHARED msandr.cc) |
| 14 | configure_DynamoRIO_client(clang_rt.msandr-${arch}) |
| 15 | |
| 16 | function(append_target_cflags tgt cflags) |
| 17 | get_property(old_cflags TARGET clang_rt.msandr-${arch} PROPERTY COMPILE_FLAGS) |
| 18 | set_property(TARGET clang_rt.msandr-${arch} PROPERTY COMPILE_FLAGS "${old_cflags} ${cflags}") |
| 19 | endfunction(append_target_cflags) |
| 20 | |
| 21 | append_target_cflags(clang_rt.msandr-${arch} "-Wno-c++11-extensions") |
| 22 | |
| 23 | use_DynamoRIO_extension(clang_rt.msandr-${arch} drutil) |
| 24 | use_DynamoRIO_extension(clang_rt.msandr-${arch} drmgr) |
| 25 | use_DynamoRIO_extension(clang_rt.msandr-${arch} drsyscall) |
| 26 | |
| 27 | set_target_properties(clang_rt.msandr-${arch} PROPERTIES |
| 28 | LIBRARY_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) |
| 29 | install(TARGETS clang_rt.msandr-${arch} |
| 30 | LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) |
| 31 | endif() |