This change introduces a CMake-style FindMySQL.cmake properly looking for libmysqlclient_r with mysql_config. This also fixes linking on some machines. Change-Id: Ifdbfdc3c7440dead37a8b63aaa86732d636aa0e2
37 lines
857 B
CMake
37 lines
857 B
CMake
set(SRCS
|
|
Importer.cc
|
|
MemoryImporter.cc
|
|
)
|
|
|
|
if (BUILD_LLVM_DISASSEMBLER)
|
|
set(SRCS ${SRCS}
|
|
InstructionImporter.cc
|
|
RegisterImporter.cc
|
|
RandomJumpImporter.cc
|
|
)
|
|
|
|
include(FindLLVM)
|
|
|
|
# llvm-config does add -fno-exception to the command line. But this
|
|
# breaks some boost libraries.
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LLVM_CXX_FLAGS} -fexceptions")
|
|
endif(BUILD_LLVM_DISASSEMBLER)
|
|
|
|
find_package(MySQL REQUIRED)
|
|
include_directories(${MYSQL_INCLUDE_DIR})
|
|
|
|
add_executable(import-trace main.cc ${SRCS})
|
|
|
|
target_link_libraries(import-trace
|
|
${PROTOBUF_LIBRARY}
|
|
${MYSQL_LIBRARIES}
|
|
fail-util
|
|
fail-comm
|
|
fail-sal)
|
|
|
|
if (BUILD_LLVM_DISASSEMBLER)
|
|
target_link_libraries(import-trace fail-llvmdisassembler fail-sal ${LLVM_LIBS} ${LLVM_LDFLAGS})
|
|
endif (BUILD_LLVM_DISASSEMBLER)
|
|
|
|
install(TARGETS import-trace RUNTIME DESTINATION bin)
|