From 780dc2291bc0e114bab8b9ccd8706708f6b47270 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 1 Aug 2018 08:42:45 +0200 Subject: Fix builds with some MinGW distributions Some distributions do not define MINGW_HAS_SECURE_API globally, resulting in methods like wgetenv_s not being declared in the headers. This is probably to keep compatibility with Windows XP. Anyhow, we don't support Windows XP anymore, so we can safely add the define. Note that this is not necessary for the mingw-builds distro, which is the only one we test and support. Anyhow, I don't see any risk in adding these for other distributions. Diff was provided by Philippe Dunski in the bug report. Task-number: QTBUG-67443 Change-Id: I3a64b11541fe95e527ed44bbf8ad94469d457d3d Reviewed-by: Friedemann Kleint --- qmake/Makefile.unix.win32 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qmake') diff --git a/qmake/Makefile.unix.win32 b/qmake/Makefile.unix.win32 index bfcad35357..48efd6f030 100644 --- a/qmake/Makefile.unix.win32 +++ b/qmake/Makefile.unix.win32 @@ -1,5 +1,5 @@ EXEEXT = .exe -EXTRA_CXXFLAGS = -DUNICODE +EXTRA_CXXFLAGS = -DUNICODE -DMINGW_HAS_SECURE_API=1 EXTRA_LFLAGS = -static -s -lole32 -luuid -ladvapi32 -lkernel32 -lnetapi32 QTOBJS = \ qfilesystemengine_win.o \ -- cgit v1.2.3 From 9d4d05ec536289d8d62cfed60e02f38febfc3052 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 25 Jul 2018 18:21:05 +0200 Subject: qmake: don't escape colons in dependency paths on windows, after all MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit amends 7c34e0a7b4. Change-Id: I2ecdf0a450337e667f55af09b3de79fb47e05428 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Joerg Bornemann Reviewed-by: Oswald Buddenhagen --- qmake/generators/makefile.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'qmake') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 580df85c1e..73e09a1025 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2829,7 +2829,16 @@ MakefileGenerator::escapeDependencyPath(const QString &path) const QString ret = path; if (!ret.isEmpty()) { // Unix make semantics, to be inherited by unix and mingw generators. +#ifdef Q_OS_UNIX + // When running on Unix, we need to escape colons (which may appear + // anywhere in a path, and would be mis-parsed as dependency separators). static const QRegExp criticalChars(QStringLiteral("([\t :#])")); +#else + // MinGW make has a hack for colons which denote drive letters, and no + // other colons may appear in paths. And escaping colons actually breaks + // the make from the Android SDK. + static const QRegExp criticalChars(QStringLiteral("([\t #])")); +#endif ret.replace(criticalChars, QStringLiteral("\\\\1")); debug_msg(2, "escapeDependencyPath: %s -> %s", path.toLatin1().constData(), ret.toLatin1().constData()); } -- cgit v1.2.3 From a09a28879e76bb011e0eefe0be0219ce396362d9 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 2 Aug 2018 16:41:14 +0200 Subject: qmake: improve the fake project qt creator's clang code model is a bit more picky than the old one, so we need a project that approximately works. while we're at it, inline qmake.pri, add some missing files, and beautify the source lists. Change-Id: I87ca1db2ee3e55ea08e4c23f7913e882ab44fd21 Reviewed-by: Joerg Bornemann --- qmake/qmake.pri | 169 --------------------------------------- qmake/qmake.pro | 243 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 229 insertions(+), 183 deletions(-) delete mode 100644 qmake/qmake.pri (limited to 'qmake') diff --git a/qmake/qmake.pri b/qmake/qmake.pri deleted file mode 100644 index f6f6a47e95..0000000000 --- a/qmake/qmake.pri +++ /dev/null @@ -1,169 +0,0 @@ - -#qmake code -SOURCES += project.cpp property.cpp main.cpp \ - library/ioutils.cpp library/proitems.cpp library/qmakevfs.cpp library/qmakeglobals.cpp \ - library/qmakeparser.cpp library/qmakeevaluator.cpp library/qmakebuiltins.cpp \ - generators/makefile.cpp \ - generators/unix/unixmake2.cpp generators/unix/unixmake.cpp meta.cpp \ - option.cpp generators/win32/winmakefile.cpp generators/win32/mingw_make.cpp \ - generators/makefiledeps.cpp generators/metamakefile.cpp generators/mac/pbuilder_pbx.cpp \ - generators/xmloutput.cpp \ - generators/win32/msvc_nmake.cpp generators/projectgenerator.cpp \ - generators/win32/msvc_vcproj.cpp \ - generators/win32/msvc_vcxproj.cpp \ - generators/win32/msvc_objectmodel.cpp generators/win32/msbuild_objectmodel.cpp - -HEADERS += project.h property.h \ - library/qmake_global.h library/ioutils.h library/proitems.h library/qmakevfs.h library/qmakeglobals.h \ - library/qmakeparser.h library/qmakeevaluator.h library/qmakeevaluator_p.h \ - generators/makefile.h \ - generators/unix/unixmake.h meta.h option.h cachekeys.h \ - generators/win32/winmakefile.h generators/win32/mingw_make.h generators/projectgenerator.h \ - generators/makefiledeps.h generators/metamakefile.h generators/mac/pbuilder_pbx.h \ - generators/xmloutput.h generators/win32/msvc_nmake.h \ - generators/win32/msvc_vcproj.h \ - generators/win32/msvc_vcxproj.h \ - generators/win32/msvc_objectmodel.h generators/win32/msbuild_objectmodel.h - -bootstrap { #Qt code - SOURCES+= \ - qbitarray.cpp \ - qbuffer.cpp \ - qarraydata.cpp \ - qbytearray.cpp \ - qbytearraymatcher.cpp \ - qcryptographichash.cpp \ - qdatetime.cpp \ - qdir.cpp \ - qdiriterator.cpp \ - qfiledevice.cpp \ - qfile.cpp \ - qabstractfileengine.cpp \ - qfileinfo.cpp \ - qfilesystementry.cpp \ - qfilesystemengine.cpp \ - qfsfileengine.cpp \ - qfsfileengine_iterator.cpp \ - qglobal.cpp \ - qnumeric.cpp \ - qhash.cpp \ - qiodevice.cpp \ - qlist.cpp \ - qlinkedlist.cpp \ - qlocale.cpp \ - qlocale_tools.cpp \ - qmalloc.cpp \ - qmap.cpp \ - qmetatype.cpp \ - qregexp.cpp \ - qtextcodec.cpp \ - qutfcodec.cpp \ - qstring.cpp \ - qstring_compat.cpp \ - qstringlist.cpp \ - qtemporaryfile.cpp \ - qtextstream.cpp \ - quuid.cpp \ - qsettings.cpp \ - qlibraryinfo.cpp \ - qsystemerror.cpp \ - qvariant.cpp \ - qversionnumber.cpp \ - qvsnprintf.cpp \ - qxmlstream.cpp \ - qxmlutils.cpp \ - qlogging.cpp \ - qjson.cpp \ - qjsondocument.cpp \ - qjsonparser.cpp \ - qjsonarray.cpp \ - qjsonobject.cpp \ - qjsonvalue.cpp - - HEADERS+= \ - qbitarray.h \ - qbuffer.h \ - qarraydata.h \ - qbytearray.h \ - qarraydataops.h \ - qarraydatapointer.h \ - qbytearraymatcher.h \ - qchar.h \ - qcryptographichash.h \ - qdatetime.h \ - qdatetime_p.h \ - qdir.h \ - qdir_p.h \ - qdiriterator.h \ - qfile.h \ - qabstractfileengine_p.h \ - qfileinfo.h \ - qglobal.h \ - qnumeric.h \ - qhash.h \ - qiodevice.h \ - qlist.h \ - qlinkedlist.h \ - qlocale.h \ - qlocale_tools_p.h \ - qmalloc.h \ - qmap.h \ - qmetatype.h \ - qregexp.h \ - qtextcodec.h \ - qutfcodec.h \ - qstring.h \ - qstringlist.h \ - qstringmatcher.h \ - qsystemerror_p.h \ - qtemporaryfile.h \ - qtextstream.h \ - quuid.h \ - qvector.h \ - qversionnumber.h \ - qxmlstream.h \ - qxmlutils.h \ - qjson.h \ - qjsondocument.h \ - qjsonparser.h \ - qjsonwriter.h \ - qjsonarray.h \ - qjsonobject.h \ - qjsonvalue.h - - unix { - SOURCES += qfilesystemengine_unix.cpp qfilesystemiterator_unix.cpp qfsfileengine_unix.cpp - mac { - SOURCES += qcore_mac.cpp qsettings_mac.cpp qcore_mac_objc.mm qlocale_mac.mm - LIBS += -framework ApplicationServices -framework CoreServices -framework Foundation - } else { - SOURCES += qlocale_unix.cpp - } - } else:win32 { - SOURCES += qfilesystemengine_win.cpp qfsfileengine_win.cpp qfilesystemiterator_win.cpp qsettings_win.cpp \ - qsystemlibrary.cpp qlocale_win.cpp registry.cpp - win32-msvc*:LIBS += ole32.lib advapi32.lib netapi32.lib - mingw:LIBS += -lole32 -luuid -ladvapi32 -lkernel32 -lnetapi32 - } - - qnx { - CFLAGS += -fhonor-std - LFLAGS += -lcpp - } - - DEFINES += QT_BOOTSTRAPPED - - INCLUDEPATH += \ - $$QT.core.includes $$QT.core_private.includes \ - $$shadowed(../src/corelib/global) -} else { - CONFIG += qt - QT = core -} -*-g++:profiling { - QMAKE_CFLAGS = -pg - QMAKE_CXXFLAGS = -pg - QMAKE_LFLAGS = -pg -} - -PRECOMPILED_HEADER = qmake_pch.h diff --git a/qmake/qmake.pro b/qmake/qmake.pro index 000aec45fc..7c3ce3ef89 100644 --- a/qmake/qmake.pro +++ b/qmake/qmake.pro @@ -3,12 +3,101 @@ # and the configures. option(host_build) -CONFIG += console bootstrap -CONFIG -= qt +CONFIG += console +CONFIG -= qt app_bundle + DEFINES += \ + PROEVALUATOR_FULL \ + QT_BOOTSTRAPPED \ QT_BUILD_QMAKE \ QT_NO_FOREACH \ - PROEVALUATOR_FULL + $$shell_quote(QT_VERSION_STR=\"$$QT_VERSION\") \ + QT_VERSION_MAJOR=$$QT_MAJOR_VERSION \ + QT_VERSION_MINOR=$$QT_MINOR_VERSION \ + QT_VERSION_PATCH=$$QT_PATCH_VERSION + +win32: DEFINES += \ + UNICODE \ + _ENABLE_EXTENDED_ALIGNED_STORAGE \ + _CRT_SECURE_NO_WARNINGS _SCL_SECURE_NO_WARNINGS + +# qmake code + +PRECOMPILED_HEADER = qmake_pch.h + +INCLUDEPATH += \ + . \ + library \ + generators \ + generators/unix \ + generators/win32 \ + generators/mac + +SOURCES += \ + main.cpp \ + meta.cpp \ + option.cpp \ + project.cpp \ + property.cpp \ + library/ioutils.cpp \ + library/proitems.cpp \ + library/qmakebuiltins.cpp \ + library/qmakeevaluator.cpp \ + library/qmakeglobals.cpp \ + library/qmakeparser.cpp \ + library/qmakevfs.cpp \ + generators/makefile.cpp \ + generators/makefiledeps.cpp \ + generators/metamakefile.cpp \ + generators/projectgenerator.cpp \ + generators/xmloutput.cpp \ + generators/mac/pbuilder_pbx.cpp \ + generators/unix/unixmake.cpp \ + generators/unix/unixmake2.cpp \ + generators/win32/mingw_make.cpp \ + generators/win32/msbuild_objectmodel.cpp \ + generators/win32/msvc_nmake.cpp \ + generators/win32/msvc_objectmodel.cpp \ + generators/win32/msvc_vcproj.cpp \ + generators/win32/msvc_vcxproj.cpp \ + generators/win32/winmakefile.cpp + +HEADERS += \ + cachekeys.h \ + meta.h \ + option.h \ + project.h \ + property.h \ + library/ioutils.h \ + library/proitems.h \ + library/qmake_global.h \ + library/qmakeevaluator.h \ + library/qmakeevaluator_p.h \ + library/qmakeglobals.h \ + library/qmakeparser.h \ + library/qmakevfs.h \ + generators/makefile.h \ + generators/makefiledeps.h \ + generators/metamakefile.h \ + generators/projectgenerator.h \ + generators/xmloutput.h \ + generators/mac/pbuilder_pbx.h \ + generators/unix/unixmake.h \ + generators/win32/mingw_make.h \ + generators/win32/msbuild_objectmodel.h \ + generators/win32/msvc_nmake.h \ + generators/win32/msvc_objectmodel.h \ + generators/win32/msvc_vcproj.h \ + generators/win32/msvc_vcxproj.h \ + generators/win32/winmakefile.h + +# qt code + +bp = $$shadowed(..) +INCLUDEPATH += \ + $$bp/include $$bp/include/QtCore \ + $$bp/include/QtCore/$$QT_VERSION $$bp/include/QtCore/$$QT_VERSION/QtCore + $$bp/src/corelib/global VPATH += \ ../src/corelib/global \ @@ -17,17 +106,143 @@ VPATH += \ ../src/corelib/codecs \ ../src/corelib/plugin \ ../src/corelib/io \ - ../src/corelib/serialization \ - ../tools/shared/windows + ../src/corelib/serialization -INCLUDEPATH += . \ - library \ - generators \ - generators/unix \ - generators/win32 \ - generators/mac \ - ../tools/shared +SOURCES += \ + qabstractfileengine.cpp \ + qarraydata.cpp \ + qbitarray.cpp \ + qbuffer.cpp \ + qbytearray.cpp \ + qbytearraymatcher.cpp \ + qcryptographichash.cpp \ + qdatetime.cpp \ + qdir.cpp \ + qdiriterator.cpp \ + qfile.cpp \ + qfiledevice.cpp \ + qfileinfo.cpp \ + qfilesystemengine.cpp \ + qfilesystementry.cpp \ + qfsfileengine.cpp \ + qfsfileengine_iterator.cpp \ + qglobal.cpp \ + qhash.cpp \ + qiodevice.cpp \ + qjson.cpp \ + qjsonarray.cpp \ + qjsondocument.cpp \ + qjsonobject.cpp \ + qjsonparser.cpp \ + qjsonvalue.cpp \ + qlibraryinfo.cpp \ + qlinkedlist.cpp \ + qlist.cpp \ + qlocale.cpp \ + qlocale_tools.cpp \ + qlogging.cpp \ + qmalloc.cpp \ + qmap.cpp \ + qmetatype.cpp \ + qnumeric.cpp \ + qregexp.cpp \ + qsettings.cpp \ + qstring.cpp \ + qstring_compat.cpp \ + qstringlist.cpp \ + qsystemerror.cpp \ + qtemporaryfile.cpp \ + qtextcodec.cpp \ + qtextstream.cpp \ + qutfcodec.cpp \ + quuid.cpp \ + qvariant.cpp \ + qversionnumber.cpp \ + qvsnprintf.cpp \ + qxmlstream.cpp \ + qxmlutils.cpp -include(qmake.pri) +HEADERS += \ + qabstractfileengine_p.h \ + qarraydata.h \ + qarraydataops.h \ + qarraydatapointer.h \ + qbitarray.h \ + qbuffer.h \ + qbytearray.h \ + qbytearraymatcher.h \ + qchar.h \ + qcryptographichash.h \ + qdatetime.h \ + qdatetime_p.h \ + qdir.h \ + qdir_p.h \ + qdiriterator.h \ + qfile.h \ + qfileinfo.h \ + qglobal.h \ + qhash.h \ + qiodevice.h \ + qjson.h \ + qjsonarray.h \ + qjsondocument.h \ + qjsonobject.h \ + qjsonparser.h \ + qjsonvalue.h \ + qjsonwriter.h \ + qlinkedlist.h \ + qlist.h \ + qlocale.h \ + qlocale_tools_p.h \ + qmalloc.h \ + qmap.h \ + qmetatype.h \ + qnumeric.h \ + qregexp.h \ + qstring.h \ + qstringlist.h \ + qstringmatcher.h \ + qsystemerror_p.h \ + qtemporaryfile.h \ + qtextcodec.h \ + qtextstream.h \ + qutfcodec.h \ + quuid.h \ + qvector.h \ + qversionnumber.h \ + qxmlstream.h \ + qxmlutils.h -load(qt_app) +unix { + SOURCES += \ + qcore_unix.cpp \ + qfilesystemengine_unix.cpp \ + qfilesystemiterator_unix.cpp \ + qfsfileengine_unix.cpp \ + qlocale_unix.cpp + macos { + SOURCES += \ + qcore_foundation.mm \ + qcore_mac.cpp \ + qoperatingsystemversion_darwin.mm \ + qsettings_mac.cpp + LIBS += \ + -framework ApplicationServices \ + -framework CoreServices \ + -framework Foundation + QMAKE_CXXFLAGS += -fconstant-cfstrings + } +} else { + SOURCES += \ + qfilesystemengine_win.cpp \ + qfilesystemiterator_win.cpp \ + qfsfileengine_win.cpp \ + qlocale_win.cpp \ + qoperatingsystemversion_win.cpp \ + qsettings_win.cpp \ + qsystemlibrary.cpp \ + registry.cpp + LIBS += -lole32 -ladvapi32 -lkernel32 -lnetapi32 + mingw: LIBS += -luuid + clang: QMAKE_CXXFLAGS += -fms-compatibility-version=19.00.23506 -Wno-microsoft-enum-value +} -- cgit v1.2.3