Skip to content
  • Chun-wei Fan's avatar
    giscanner: Do not use distutils for linking · 5d4cd252
    Chun-wei Fan authored
    ...the dumper program for all cases.  It turned out that using distutils
    for linking is more troublesome than useful as we need to ensure that
    the paths specified by -L need to come before the standard library search
    paths, and distutil's ccompiler.add_library_path() and
    ccompiler.add_runtime_library_path() does not work for all of its
    supported compilers (Visual Studio is an example).
    
    Instead, we go back to constructing our linker command line manually as
    we did before (and as we now do in the libtool case), but with some
    enhancements:
    
    -Use '-libpath:' on Visual Studio builds, which corresponds to the -L flag
     on GCC/CLang.
    -Extend LIB/PATH (Windows/Visual Studio) or LD_LIBRARY_PATH (other
     compilers/envs), which is necessary as we resolve the libraries that
     are passed into g-ir-scanner, at least on Windows.
    -Don't attempt to link to or resolve m.lib on Visual Studio builds, as
     the math functions are in the standard CRT .lib/.dll, and there is no
     such thing as m.lib
    
    https://bugzilla.gnome.org/show_bug.cgi?id=781525
    5d4cd252