diff options
author | Arvid Nilsson <anilsson@blackberry.com> | 2013-09-26 14:26:25 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-28 10:58:19 +0200 |
commit | cd51a2cdcfaaa176cb0935d01988dceb9941517b (patch) | |
tree | a9f48b13b56a4490dc6eb1f51327f3437d3b5f25 | |
parent | a3eaa1530feed293f966bb2a886d9efb6bed5f44 (diff) |
Differentiate between libraries and linker flags in gyp_generator.prf
GYP has a section named libraries under linker_settings, as well as an
ldflags section. Previously, we put all of qmake's LIBS under ldflags,
but this patch extracts all "-l" entries in LIBS and puts them as
"libraries" instead of "ldflags". This causes our libraries to be
grouped together with chromium's libraries at the end of the linker
line, before they were grouped together with other ldflags at the
beginning of the linker line. Also, it fixes the build on my machine.
Change-Id: I0ff9cde0d954a928dc5e880d7ed822a7b8edbf64
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
-rw-r--r-- | build/qmake/mkspecs/features/gyp_generator.prf | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/build/qmake/mkspecs/features/gyp_generator.prf b/build/qmake/mkspecs/features/gyp_generator.prf index 85dbd838c..793655134 100644 --- a/build/qmake/mkspecs/features/gyp_generator.prf +++ b/build/qmake/mkspecs/features/gyp_generator.prf @@ -70,6 +70,13 @@ GYP_CONTENTS += " 'includes': [" for (incl, GYPINCLUDES): GYP_CONTENTS += " '$$incl'," GYP_CONTENTS += " ]," } + +# Split LIBS into linker flags and actual libraries, and add them to the +# appropriate section (ldflags vs link_settings: libraries) in the gyp file. +LIBRARIES = $$find(LIBS, "-l") +LIBRARIES = $$unique(LIBRARIES) +for (library, LIBRARIES): LIBS -= "$$library" + GYP_CONTENTS += " 'ldflags': [" for (lib, LIBS): GYP_CONTENTS += " '$$lib'," !isEmpty(QMAKE_RPATHDIR): GYP_CONTENTS += " '$$QMAKE_RPATH$$QMAKE_RPATHDIR'," @@ -85,9 +92,10 @@ GYP_CONTENTS += " ]," for(flag, QMAKE_CXXFLAGS): GYP_CONTENTS += " '$$flag'," GYP_CONTENTS += " ]," } +GYP_CONTENTS += " 'link_settings': {" \ + " 'libraries': [" +for (library, LIBRARIES): GYP_CONTENTS += " '$$library'," macx { - GYP_CONTENTS += " 'link_settings': {" \ - " 'libraries': [" FRAMEWORKS = $$find(LIBS, "Q*") FRAMEWORKS = $$unique(FRAMEWORKS) FRAMEWORKS ~= s/-.*/ @@ -102,10 +110,9 @@ macx { FRAMEWORK_PATHS -= "-framework" for (framework_path, FRAMEWORK_PATHS): GYP_CONTENTS += " '$$framework_path'," !isEmpty(QMAKE_FRAMEWORKPATH): GYP_CONTENTS += " '-F$$QMAKE_FRAMEWORKPATH'," - - GYP_CONTENTS += " ]," \ - " }," } +GYP_CONTENTS += " ]," \ + " }," !isEmpty(GYPDEPENDENCIES) { GYP_CONTENTS += " 'dependencies': [" |