summaryrefslogtreecommitdiff
path: root/cmake
diff options
authorJussi Pakkanen <jussi.pakkanen@canonical.com>2012-12-20 11:33:50 +0200
committerJussi Pakkanen <jussi.pakkanen@canonical.com>2012-12-20 11:33:50 +0200
commit3d6a70a55d60fd9236799d9a92c61354faa6037f (patch)
tree588370d9827e96362bcce5dce22538a4f0dafbe9 /cmake
parente01a31e8f419953b8039ea04321b0fe353ac8b09 (diff)
Set pch include dir as a target property rather than a global flag.
(bzr r3004.1.3)
Diffstat (limited to 'cmake')
-rw-r--r--cmake/pch.cmake6
1 files changed, 1 insertions, 5 deletions
diff --git a/cmake/pch.cmake b/cmake/pch.cmake
index bf9c55593..409426bc0 100644
--- a/cmake/pch.cmake
+++ b/cmake/pch.cmake
@@ -53,12 +53,8 @@ function(add_pch_linux header_filename target_name pch_suffix)
# This is the only way that is supported by both GCC and Clang.
set_property(TARGET ${target_name} APPEND_STRING PROPERTY COMPILE_FLAGS " -include ${header_basename} ")
set_property(TARGET ${target_name} APPEND_STRING PROPERTY COMPILE_FLAGS " -Winvalid-pch ")
+ set_property(TARGET ${target_name} APPEND PROPERTY INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR})
- # Each directory should have only one precompiled header
- # for simplicity. If there are several, the current dir
- # gets added to the search path several times.
- # It should not be an issue, though.
- include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
endfunction()
try_run(IS_CLANG did_build ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/isclang.cc)