diff options
| author | Jussi Pakkanen <jussi.pakkanen@canonical.com> | 2012-12-21 14:29:36 +0200 |
|---|---|---|
| committer | Jussi Pakkanen <jussi.pakkanen@canonical.com> | 2012-12-21 14:29:36 +0200 |
| commit | 9f9536f286dc88521553dbafaaaceaf6df879b05 (patch) | |
| tree | 8851e976a62a9a1727dae43e040399f9116d763a /cmake | |
| parent | 8e67682c465eb0e97ee85e81b1438e891d14be56 (diff) | |
Find more used compiler flags for pch.
(bzr r3006.2.1)
Diffstat (limited to 'cmake')
| -rw-r--r-- | cmake/pch.cmake | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cmake/pch.cmake b/cmake/pch.cmake index 409426bc0..9b038cf47 100644 --- a/cmake/pch.cmake +++ b/cmake/pch.cmake @@ -23,6 +23,10 @@ function(get_gcc_flags target_name) foreach(item ${dir_defs}) list(APPEND compile_args -D${item}) endforeach() + get_directory_property(dir_buildtype_defs COMPILE_DEFINITIONS_${buildtype_name}) + foreach(item ${dir_buildtype_defs}) + list(APPEND compile_args -D${item}) + endforeach() get_directory_property(buildtype_defs COMPILE_DEFINITIONS_${buildtype_name}) foreach(item ${buildtype_defs}) list(APPEND compile_args -D${item}) @@ -31,6 +35,22 @@ function(get_gcc_flags target_name) if(${target_type} STREQUAL SHARED_LIBRARY) list(APPEND compile_args ${CMAKE_CXX_COMPILE_OPTIONS_PIC}) endif() + get_target_property(target_defs ${target_name} COMPILE_DEFINITIONS) + if(target_defs) + foreach(item ${target_defs}) + list(APPEND compile_args -D${item}) + endforeach() + endif() + get_target_property(target_buildtype_defs ${target_name} COMPILE_DEFINITIONS_${buildtype_name}) + if(target_buildtype_defs) + foreach(item ${target_buildtype_defs}) + list(APPEND compile_args -D${item}) + endforeach() + endif() + get_target_property(target_flags ${target_name} COMPILE_FLAGS) + if(target_flags) + list(APPEND compile_args ${target_flags}) + endif() set(compile_args ${compile_args} PARENT_SCOPE) #message(STATUS ${compile_args}) endfunction() |
