Skip to content

Commit

Permalink
qmake: fix QMAKE_DEFAULT_LIBDIRS detection on android
Browse files Browse the repository at this point in the history
amazingly enough, android has different sysroots for the compiler
(shared includes full of #ifdefs) and the linker (per-platform
libraries).

this patch supports only clang for non-darwin, which notably covers all
supported android ndks.

with this fixed, we also remove the hard-coded setting of
QMAKE_DEFAULT_*DIRS from the specs.

amends 353fb11.

Change-Id: Ie0513de0f7123d7f5b8ca1ffcc72c017cddd126c
Reviewed-by: Joerg Bornemann <[email protected]>
Reviewed-by: Oswald Buddenhagen <[email protected]>
  • Loading branch information
ossilator committed Dec 3, 2018
1 parent 4931973 commit 46a2b44
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions mkspecs/common/android-base-tail.conf
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,3 @@ QMAKE_LIBS_OPENGL_ES2 = -lGLESv2
!exists($$NDK_ROOT): error("You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.")

load(qt_config)

QMAKE_DEFAULT_LIBDIRS = $$QMAKE_LIBDIR
QMAKE_DEFAULT_INCDIRS = $$QMAKE_INCDIR
4 changes: 2 additions & 2 deletions mkspecs/features/toolchain.prf
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ isEmpty($${target_prefix}.INCDIRS) {
# paths, so it can't just be used in place of the above code).
# What's more, -print-search-dirs can't be used on clang on Apple because it
# won't print all the library paths (only the clang-internal ones).
output = $$system("$$cmd_prefix $$QMAKE_CXX -print-search-dirs", lines, ec)
!equals(ec, 0): qtCompilerErrror($$QMAKE_CXX, $$output)
output = $$system("$$cmd_prefix $$QMAKE_LINK $$QMAKE_LFLAGS -print-search-dirs", lines, ec)
!equals(ec, 0): qtCompilerErrror($$QMAKE_LINK, $$output)

for (line, output) {
contains(line, "^libraries: .*") {
Expand Down

0 comments on commit 46a2b44

Please sign in to comment.