[evolution/wip/lantw/include-ldflags-in-gtkdoc-scangobj-command-line] Include LDFLAGS in gtkdoc-scangobj command line



commit 48f13234656874fb23588beeecb26206de102b4d
Author: Ting-Wei Lan <lantw src gnome org>
Date:   Mon Jul 22 16:17:30 2019 +0800

    Include LDFLAGS in gtkdoc-scangobj command line
    
    Sync changes from evolution-data-server:
    https://gitlab.gnome.org/GNOME/evolution-data-server/merge_requests/28

 cmake/modules/GtkDoc.cmake | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/cmake/modules/GtkDoc.cmake b/cmake/modules/GtkDoc.cmake
index cc6cc007a4..0ba1a7a78a 100644
--- a/cmake/modules/GtkDoc.cmake
+++ b/cmake/modules/GtkDoc.cmake
@@ -96,9 +96,8 @@ macro(add_gtkdoc _module _namespace _deprecated_guards _srcdirsvar _depsvar _ign
                list(APPEND _scangobj_deps ${opt})
        endforeach(opt)
 
-       # Add them as the last, thus in-tree headers/libs have precedence
+       # Add it as the last, thus in-tree headers have precedence
        list(APPEND _scangobj_cflags_list -I${INCLUDE_INSTALL_DIR})
-       list(APPEND _scangobj_ldflags -L${LIB_INSTALL_DIR})
 
        if(_scangobj_deps)
                list(REMOVE_DUPLICATES _scangobj_deps)
@@ -122,7 +121,7 @@ macro(add_gtkdoc _module _namespace _deprecated_guards _srcdirsvar _depsvar _ign
                                if(NOT _output_name)
                                        set(_output_name ${opt})
                                endif(NOT _output_name)
-                               set(_scangobj_ldflags "-L$<TARGET_FILE_DIR:${opt}> -l${_output_name} 
${_scangobj_ldflags}")
+                               set(_scangobj_ldflags "${_scangobj_ldflags} -L$<TARGET_FILE_DIR:${opt}> 
-l${_output_name}")
 
                                if(_target_type STREQUAL "SHARED_LIBRARY" OR (_target_type STREQUAL 
"MODULE_LIBRARY"))
                                        set(_scangobj_ld_lib_dirs 
"${_scangobj_ld_lib_dirs}:$<TARGET_FILE_DIR:${opt}>")
@@ -133,12 +132,18 @@ macro(add_gtkdoc _module _namespace _deprecated_guards _srcdirsvar _depsvar _ign
                endif(TARGET ${opt})
        endforeach(opt)
 
+       # Add extra flags from LDFLAGS environment variable
+       set(_scangobj_ldflags "${_scangobj_ldflags} ${CMAKE_SHARED_LINKER_FLAGS}")
+
        foreach(opt IN LISTS _scangobj_deps)
                if(NOT TARGET ${opt})
                        set(_scangobj_ldflags "${_scangobj_ldflags} ${opt}")
                endif(NOT TARGET ${opt})
        endforeach(opt)
 
+       # Add it as the last, thus in-tree libs have precedence
+       set(_scangobj_ldflags "${_scangobj_ldflags} -L${LIB_INSTALL_DIR}")
+
        set(_scangobj_prefix ${CMAKE_COMMAND} -E env 
LD_LIBRARY_PATH="${_scangobj_ld_lib_dirs}:${LIB_INSTALL_DIR}:$ENV{LD_LIBRARY_PATH}")
 
        if(NOT (_scangobj_cflags STREQUAL ""))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]