Skip to content

Commit

Permalink
qmake: fix ios config test for qt5.6
Browse files Browse the repository at this point in the history
ios and simulator use the same spec since 5.6. need additional CONFIG
+=iphoneos for qmake
  • Loading branch information
wang-bin committed Feb 25, 2016
1 parent d7cec3b commit 8c36b1b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config.tests/paths.pri
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TEMPLATE = lib # can not create exe for some platforms (winrt, ios). If check header only, staticlib is fine
# not static lib because sometimes we need to check link flags
# not static lib because sometimes we need to check link flags. if qt is static build, this chek may fail. we don't test link for static build because it's impossible to add all dependencies to link flags
INCLUDEPATH += $$[QT_INSTALL_HEADERS]
LIBS += -L$$[QT_INSTALL_LIBS]
CONFIG -= qt app_bundle lib_bundle
Expand Down
9 changes: 8 additions & 1 deletion configure.pri
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,21 @@ defineTest(qtCompileTest) {
#system always call win32 cmd in windows, so we need "cd /d" to ensure success cd to a different partition
contains(QMAKE_HOST.os,Windows):test_cmd_base = "cd /d $$system_quote($$system_path($$test_out_dir)) &&"
else: test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&"

# On WinRT we need to change the entry point as we cannot create windows applications
winrt {
qmake_configs += " \"QMAKE_LFLAGS+=/ENTRY:main\""
}
# Disable qmake features which are typically counterproductive for tests
qmake_configs = "\"CONFIG -= qt debug_and_release app_bundle lib_bundle\""

# Clean up after previous run
exists($$test_out_dir/Makefile):qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE distclean")

mkpath($$test_out_dir)#|error("Aborting.") #mkpath currently return false, do not know why
qtRunLoggedCommand("$$test_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) $$qmake_configs $$system_path($$test_dir)") {
SPEC =
!isEmpty(QMAKESPEC): SPEC = "-spec $$QMAKESPEC"
qtRunLoggedCommand("$$test_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) $$SPEC $$qmake_configs $$system_path($$test_dir)") {
qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE") {
log("yes$$escape_expand(\\n)")
msg = "test $$1 succeeded"
Expand Down
6 changes: 5 additions & 1 deletion root.pri
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,15 @@ defineTest(testArch) {
else:test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&"
# Disable qmake features which are typically counterproductive for tests
qmake_configs = "\"CONFIG -= qt debug_and_release app_bundle lib_bundle\""
iphoneos: qmake_configs += "\"CONFIG+=iphoneos\""
iphonesimulator: qmake_configs += "\"CONFIG+=iphonesimulator\""
# Clean up after previous run
exists($$test_out_dir/Makefile):qtRunCommandQuitly("$$test_cmd_base $$QMAKE_MAKE distclean")

#message("$$test_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) $$qmake_configs $$system_path($$test_dir)")
qtRunCommandQuitly("$$test_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) $$qmake_configs $$system_path($$test_dir)") {
SPEC =
!isEmpty(QMAKESPEC): SPEC = "-spec $$QMAKESPEC"
qtRunCommandQuitly("$$test_cmd_base $$system_quote($$system_path($$QMAKE_QMAKE)) $$SPEC $$qmake_configs $$system_path($$test_dir)") {
MSG=$$system("$$test_cmd_base $$QMAKE_MAKE 2>&1")
}
V = $$find(MSG, ARCH.*=.*)
Expand Down

0 comments on commit 8c36b1b

Please sign in to comment.