summaryrefslogtreecommitdiff
path: root/buildsystems
diff options
context:
space:
mode:
authorStefan Sauer <ensonic@hora-obscura.de>2018-11-18 20:28:12 +0000
committerStefan Sauer <ensonic@hora-obscura.de>2018-11-18 20:28:12 +0000
commitc0b54cb77441504995af38967520673115350af1 (patch)
treecf1e4db9bc763126ebbea5f1070cd408c9b64a27 /buildsystems
parenta33425ea216c3245664751d64083745567ccfa8e (diff)
parentf4314aab244741212a46ff8ac85a9a81e85137d4 (diff)
downloadgtk-doc-c0b54cb77441504995af38967520673115350af1.tar.gz
Merge branch 'wip/tintou/flags' into 'master'
cmake: pass the right flags to gtk-scangobj See merge request GNOME/gtk-doc!16
Diffstat (limited to 'buildsystems')
-rw-r--r--buildsystems/cmake/GtkDocConfig.cmake15
1 files changed, 7 insertions, 8 deletions
diff --git a/buildsystems/cmake/GtkDocConfig.cmake b/buildsystems/cmake/GtkDocConfig.cmake
index 5f1d32e..57b2aac 100644
--- a/buildsystems/cmake/GtkDocConfig.cmake
+++ b/buildsystems/cmake/GtkDocConfig.cmake
@@ -370,7 +370,10 @@ endfunction(gtk_doc_add_module)
function(_gtk_doc_get_cflags_for_target result_var target)
get_target_property(target_definitions ${target} COMPILE_DEFINITIONS)
if(target_definitions)
- list(APPEND cflags ${target_definitions})
+ foreach(target_definition ${target_definitions})
+ # We need to prepend -D to the definition flag
+ list(APPEND cflags -D${target_definition})
+ endforeach()
endif()
get_target_property(target_options ${target} COMPILE_OPTIONS)
@@ -401,16 +404,12 @@ function(_gtk_doc_get_ldflags_for_target result_var target all_targets)
list(FIND all_targets ${target_library} target_library_is_explicit_dependency)
if(NOT ${target_library_is_explicit_dependency} EQUAL -1)
# This target is part of the current project. We will add it to
- # LDFLAGS explicitly, so don't try to add it with -l<target> as
- # well. In fact, we can't do that, as the containing directory
+ # LDFLAGS explicitly, so don't try to add it as well.
+ # In fact, we can't do that, as the containing directory
# probably won't be in the linker search path, and we can't find
# that out and add it ourselves.
- elseif(EXISTS ${target_library})
- # Pass the filename directly to the linker.
- list(APPEND ldflags "${target_library}")
else()
- # Pass -l<filename> to the linker.
- list(APPEND ldflags "${CMAKE_LINK_LIBRARY_FLAG}${target_library}")
+ list(APPEND ldflags "${target_library}")
endif()
endforeach()