summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-05-20 16:06:32 -0500
committerJohn Wiegley <johnw@newartisans.com>2012-05-20 16:06:32 -0500
commit54649d1b7a6e7168a89ef34b812b90400f4fa225 (patch)
tree658f332cc626e71a6bc572d1033ef529a20f805d /CMakeLists.txt
parenta916ed87bc18476cb8efdcdc703ada98793d09e1 (diff)
downloadfork-ledger-54649d1b7a6e7168a89ef34b812b90400f4fa225.tar.gz
fork-ledger-54649d1b7a6e7168a89ef34b812b90400f4fa225.tar.bz2
fork-ledger-54649d1b7a6e7168a89ef34b812b90400f4fa225.zip
Make profiling builds work with Clang
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 13 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index db74b8dc..b91eaa29 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,6 +29,11 @@ else()
set(DEBUG_MODE 0)
endif()
+if(CLANG_GCOV)
+ set(PROFILE_LIBS profile_rt)
+ set(CMAKE_REQUIRED_LIBRARIES ${PROFILE_LIBS})
+endif()
+
########################################################################
find_package(PythonInterp) # Used for running tests
@@ -111,7 +116,7 @@ endif()
cmake_push_check_state()
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_INCLUDE_PATH} ${Boost_INCLUDE_DIRS})
-set(CMAKE_REQUIRED_LIBRARIES ${Boost_LIBRARIES} icuuc)
+set(CMAKE_REQUIRED_LIBRARIES ${Boost_LIBRARIES} icuuc ${PROFILE_LIBS})
check_cxx_source_runs("
#include <boost/regex/icu.hpp>
@@ -239,6 +244,7 @@ macro(add_ledger_library_dependencies _target)
if(HAVE_BOOST_REGEX_UNICODE)
target_link_libraries(${_target} icuuc)
endif()
+ target_link_libraries(${_target} ${PROFILE_LIBS})
endmacro(add_ledger_library_dependencies _target)
########################################################################
@@ -256,6 +262,12 @@ configure_file(
${PROJECT_SOURCE_DIR}/src/system.hh.in
${PROJECT_BINARY_DIR}/system.hh)
+if(CMAKE_CXX_COMPILER MATCHES "clang")
+ set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
+elseif(CMAKE_CXX_COMPILER MATCHES "g\\+\\+")
+ set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
+endif()
+
add_subdirectory(src)
if(BUILD_DOCS)
add_subdirectory(doc)