diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2019-04-16 16:32:08 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2019-04-16 16:32:08 +0200 |
commit | 6630937e63ae5797487b86743a7733c8ae5cc42c (patch) | |
tree | 3d53dacf6430f9099e1fb20835881205de674961 /qmake | |
parent | 37ed6dae00640f9cc980ffda05347c12a7eb5d7e (diff) | |
parent | c7af193d2e49e9f10b86262e63d8d13abf72b5cf (diff) |
Merge commit 'dev' into 'wip/cmake-merge'
Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
Diffstat (limited to 'qmake')
34 files changed, 695 insertions, 596 deletions
diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index dc4c88f2a5..d40ec9119b 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -1,155 +1,210 @@ +# Generated from qmake.pro. + +# special case: install(DIRECTORY "${PROJECT_SOURCE_DIR}/mkspecs" DESTINATION ${INSTALL_DATADIR}) -find_library(FWApplicationServices ApplicationServices) -find_library(FWCoreServices CoreServices) -find_library(FWFoundation Foundation) +find_library(FWApplicationServices ApplicationServices) # special case +find_library(FWCoreServices CoreServices) # special case +find_library(FWFoundation Foundation) # special case + +##################################################################### +## qmake Binary: +##################################################################### -add_qt_tool(qmake +add_qt_tool(qmake # special case + # GUI # special case: remove this SOURCES - 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/mac/pbuilder_pbx.cpp - generators/makefile.cpp - generators/makefiledeps.cpp - generators/metamakefile.cpp - generators/projectgenerator.cpp + ../src/corelib/codecs/qutfcodec.cpp ../src/corelib/codecs/qutfcodec_p.h + ../src/corelib/global/qglobal.cpp ../src/corelib/global/qglobal.h + ../src/corelib/global/qlibraryinfo.cpp + ../src/corelib/global/qlogging.cpp + ../src/corelib/global/qmalloc.cpp + ../src/corelib/global/qnumeric.cpp ../src/corelib/global/qnumeric.h + ../src/corelib/io/qabstractfileengine.cpp ../src/corelib/io/qabstractfileengine_p.h + ../src/corelib/io/qbuffer.cpp ../src/corelib/io/qbuffer.h + ../src/corelib/io/qdir.cpp ../src/corelib/io/qdir.h ../src/corelib/io/qdir_p.h + ../src/corelib/io/qdiriterator.cpp ../src/corelib/io/qdiriterator.h + ../src/corelib/io/qfile.cpp ../src/corelib/io/qfile.h + ../src/corelib/io/qfiledevice.cpp + ../src/corelib/io/qfileinfo.cpp ../src/corelib/io/qfileinfo.h + ../src/corelib/io/qfilesystemengine.cpp + ../src/corelib/io/qfilesystementry.cpp + ../src/corelib/io/qfsfileengine.cpp + ../src/corelib/io/qfsfileengine_iterator.cpp + ../src/corelib/io/qiodevice.cpp ../src/corelib/io/qiodevice.h + ../src/corelib/io/qsettings.cpp + ../src/corelib/io/qtemporaryfile.cpp ../src/corelib/io/qtemporaryfile.h + ../src/corelib/kernel/qmetatype.cpp ../src/corelib/kernel/qmetatype.h + ../src/corelib/kernel/qsystemerror.cpp ../src/corelib/kernel/qsystemerror_p.h + ../src/corelib/kernel/qvariant.cpp + ../src/corelib/plugin/quuid.cpp ../src/corelib/plugin/quuid.h + ../src/corelib/serialization/qjson.cpp ../src/corelib/serialization/qjson_p.h + ../src/corelib/serialization/qjsonarray.cpp ../src/corelib/serialization/qjsonarray.h + ../src/corelib/serialization/qjsondocument.cpp ../src/corelib/serialization/qjsondocument.h + ../src/corelib/serialization/qjsonobject.cpp ../src/corelib/serialization/qjsonobject.h + ../src/corelib/serialization/qjsonparser.cpp ../src/corelib/serialization/qjsonparser_p.h + ../src/corelib/serialization/qjsonvalue.cpp ../src/corelib/serialization/qjsonvalue.h + ../src/corelib/serialization/qjsonwriter_p.h + ../src/corelib/serialization/qtextstream.cpp ../src/corelib/serialization/qtextstream.h + ../src/corelib/serialization/qxmlstream.cpp ../src/corelib/serialization/qxmlstream.h + ../src/corelib/serialization/qxmlutils.cpp ../src/corelib/serialization/qxmlutils_p.h + ../src/corelib/tools/qarraydata.cpp ../src/corelib/tools/qarraydata.h + ../src/corelib/tools/qarraydataops.h + ../src/corelib/tools/qarraydatapointer.h + ../src/corelib/tools/qbitarray.cpp ../src/corelib/tools/qbitarray.h + ../src/corelib/tools/qbytearray.cpp ../src/corelib/tools/qbytearray.h + ../src/corelib/tools/qbytearraymatcher.cpp ../src/corelib/tools/qbytearraymatcher.h + ../src/corelib/tools/qchar.h + ../src/corelib/tools/qcryptographichash.cpp ../src/corelib/tools/qcryptographichash.h + ../src/corelib/tools/qdatetime.cpp ../src/corelib/tools/qdatetime.h ../src/corelib/tools/qdatetime_p.h + ../src/corelib/tools/qhash.cpp ../src/corelib/tools/qhash.h + ../src/corelib/tools/qlinkedlist.cpp ../src/corelib/tools/qlinkedlist.h + ../src/corelib/tools/qlist.cpp ../src/corelib/tools/qlist.h + ../src/corelib/tools/qlocale.cpp ../src/corelib/tools/qlocale.h + ../src/corelib/tools/qlocale_tools.cpp ../src/corelib/tools/qlocale_tools_p.h + ../src/corelib/tools/qmap.cpp ../src/corelib/tools/qmap.h + ../src/corelib/tools/qregexp.cpp ../src/corelib/tools/qregexp.h + ../src/corelib/tools/qstring.cpp ../src/corelib/tools/qstring.h + ../src/corelib/tools/qstring_compat.cpp + ../src/corelib/tools/qstringlist.cpp ../src/corelib/tools/qstringlist.h + ../src/corelib/tools/qstringmatcher.h + ../src/corelib/tools/qvector.h + ../src/corelib/tools/qversionnumber.cpp ../src/corelib/tools/qversionnumber.h + ../src/corelib/tools/qvsnprintf.cpp + cachekeys.h + generators/mac/pbuilder_pbx.cpp generators/mac/pbuilder_pbx.h + generators/makefile.cpp generators/makefile.h + generators/makefiledeps.cpp generators/makefiledeps.h + generators/metamakefile.cpp generators/metamakefile.h + generators/projectgenerator.cpp generators/projectgenerator.h + generators/unix/unixmake.cpp generators/unix/unixmake.h generators/unix/unixmake2.cpp - generators/unix/unixmake.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 - generators/xmloutput.cpp - - ${PROJECT_SOURCE_DIR}/src/corelib/codecs/qtextcodec.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/codecs/qutfcodec.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/global/qendian.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/global/qglobal.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/global/qlibraryinfo.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/global/qlogging.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/global/qmalloc.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/global/qnumeric.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/global/qoperatingsystemversion.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/global/qrandom.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qabstractfileengine.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qbuffer.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qdebug.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qdir.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qdiriterator.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qfile.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qfiledevice.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qfileinfo.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qfilesystemengine.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qfilesystementry.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qfsfileengine.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qfsfileengine_iterator.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qiodevice.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qsettings.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qtemporaryfile.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/kernel/qmetatype.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/kernel/qsystemerror.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/kernel/qvariant.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/plugin/quuid.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qdatastream.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qjsonarray.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qjson.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qjsondocument.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qjsonobject.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qjsonparser.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qjsonvalue.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qtextstream.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qxmlstream.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qxmlutils.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qarraydata.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qbitarray.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qbytearray.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qbytearraymatcher.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qcryptographichash.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qdatetime.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qhash.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qlinkedlist.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qlist.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qlocale.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qlocale_tools.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qmap.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qregexp.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qringbuffer.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qstringbuilder.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qstring_compat.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qstring.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qstringlist.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qversionnumber.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qvsnprintf.cpp - + generators/win32/mingw_make.cpp generators/win32/mingw_make.h + generators/win32/msbuild_objectmodel.cpp generators/win32/msbuild_objectmodel.h + generators/win32/msvc_nmake.cpp generators/win32/msvc_nmake.h + generators/win32/msvc_objectmodel.cpp generators/win32/msvc_objectmodel.h + generators/win32/msvc_vcproj.cpp generators/win32/msvc_vcproj.h + generators/win32/msvc_vcxproj.cpp generators/win32/msvc_vcxproj.h + generators/win32/winmakefile.cpp generators/win32/winmakefile.h + generators/xmloutput.cpp generators/xmloutput.h + library/ioutils.cpp library/ioutils.h + library/proitems.cpp library/proitems.h + library/qmake_global.h + library/qmakebuiltins.cpp + library/qmakeevaluator.cpp library/qmakeevaluator.h library/qmakeevaluator_p.h + library/qmakeglobals.cpp library/qmakeglobals.h + library/qmakeparser.cpp library/qmakeparser.h + library/qmakevfs.cpp library/qmakevfs.h main.cpp + meta.cpp meta.h + option.cpp option.h + project.cpp project.h + property.cpp property.h DEFINES - QT_VERSION_STR="${PROJECT_VERSION}" - QT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} - QT_VERSION_MINOR=${PROJECT_VERSION_MINOR} - QT_VERSION_PATCH=${PROJECT_VERSION_PATCH} - QT_BUILD_QMAKE QT_BOOTSTRAPPED PROEVALUATOR_FULL + PROEVALUATOR_FULL + QT_BOOTSTRAPPED + QT_BUILD_QMAKE QT_NO_FOREACH + QT_VERSION_STR="${PROJECT_VERSION}" # special case + QT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} # special case + QT_VERSION_MINOR=${PROJECT_VERSION_MINOR} # special case + QT_VERSION_PATCH=${PROJECT_VERSION_PATCH} # special case INCLUDE_DIRECTORIES + # . # special case library generators generators/unix generators/win32 generators/mac + $<TARGET_PROPERTY:Qt::CorePrivate,INTERFACE_INCLUDE_DIRECTORIES> # special case + ${CMAKE_BINARY_DIR}/src/corelib/global # special case: for qconfig.cpp +) + +qt_internal_add_target_aliases(Bootstrap) # special case + +#### Keys ignored in scope 1:.:.:qmake.pro:<TRUE>: +# CONFIG = "cmdline" "-qt" +# PRECOMPILED_HEADER = "qmake_pch.h" +# _OPTION = "host_build" + +## Scopes: +##################################################################### - ${PROJECT_BINARY_DIR}/include - ${PROJECT_BINARY_DIR}/include/QtCore - ${PROJECT_BINARY_DIR}/include/QtCore/${PROJECT_VERSION} - ${PROJECT_BINARY_DIR}/include/QtCore/${PROJECT_VERSION}/QtCore - ${PROJECT_BINARY_DIR}/src/corelib/global +extend_target(qmake CONDITION WIN32 + SOURCES + ../src/corelib/global/qoperatingsystemversion_win.cpp + ../src/corelib/io/qfilesystemengine_win.cpp + ../src/corelib/io/qfilesystemiterator_win.cpp + ../src/corelib/io/qfsfileengine_win.cpp + ../src/corelib/io/qsettings_win.cpp + ../src/corelib/plugin/qsystemlibrary.cpp + ../src/corelib/tools/qlocale_win.cpp + library/registry.cpp # special case + DEFINES + UNICODE + _ENABLE_EXTENDED_ALIGNED_STORAGE + _CRT_SECURE_NO_WARNINGS + _SCL_SECURE_NO_WARNINGS + PUBLIC_LIBRARIES + advapi32 + kernel32 + netapi32 + ole32 ) extend_target(qmake CONDITION UNIX SOURCES - ${PROJECT_SOURCE_DIR}/src/corelib/kernel/qcore_unix.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qfilesystemengine_unix.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qfilesystemiterator_unix.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qfsfileengine_unix.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qlocale_unix.cpp + ../src/corelib/io/qfilesystemengine_unix.cpp + ../src/corelib/io/qfilesystemiterator_unix.cpp + ../src/corelib/io/qfsfileengine_unix.cpp + ../src/corelib/kernel/qcore_unix.cpp + ../src/corelib/tools/qlocale_unix.cpp ) extend_target(qmake CONDITION APPLE_OSX SOURCES - ${PROJECT_SOURCE_DIR}/src/corelib/kernel/qcore_foundation.mm - ${PROJECT_SOURCE_DIR}/src/corelib/kernel/qcore_mac.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/global/qoperatingsystemversion_darwin.mm - ${PROJECT_SOURCE_DIR}/src/corelib/io/qsettings_mac.cpp - LIBRARIES - ${FWApplicationServices} ${FWCoreServices} ${FWFoundation} + ../src/corelib/kernel/qcore_foundation.mm # special case + ../src/corelib/kernel/qcore_mac.cpp # special case + ../src/corelib/global/qoperatingsystemversion_darwin.mm # special case + ../src/corelib/io/qsettings_mac.cpp # special case + PUBLIC_LIBRARIES + ${FWApplicationServices} + ${FWCoreServices} + ${FWFoundation} + COMPILE_OPTIONS + "-fconstant-cfstrings" ) -# TODO: Windows support, cf. qmake.pro + +# special case big extend_target(qmake CONDITION WIN32 SOURCES - ${PROJECT_SOURCE_DIR}/src/corelib/io/qfilesystemengine_win.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qfilesystemiterator_win.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qfsfileengine_win.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/tools/qlocale_win.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/global/qoperatingsystemversion_win.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/io/qsettings_win.cpp - ${PROJECT_SOURCE_DIR}/src/corelib/plugin/qsystemlibrary.cpp - generators/win32/registry.cpp + ../src/corelib/io/qfilesystemengine_win.cpp + ../src/corelib/io/qfilesystemiterator_win.cpp + ../src/corelib/io/qfsfileengine_win.cpp + ../src/corelib/tools/qlocale_win.cpp + ../src/corelib/io/qsettings_win.cpp + ../src/corelib/global/qoperatingsystemversion.cpp + ../src/corelib/global/qoperatingsystemversion_win.cpp + ../src/corelib/plugin/qsystemlibrary.cpp + library/registry.cpp DEFINES UNICODE _ENABLE_EXTENDED_ALIGNED_STORAGE _CRT_SECURE_NO_WARNINGS _SCL_SECURE_NO_WARNINGS LIBRARIES ole32 advapi32 kernel32 netapi32 ) +extend_target(qmake CONDITION WIN32 AND mingw + PUBLIC_LIBRARIES + uuid +) + +extend_target(qmake CONDITION CLANG AND WIN32 + COMPILE_OPTIONS + "-fms-compatibility-version=19.00.23506" + "-Wno-microsoft-enum-value" +) + +# special case: set_target_properties(qmake PROPERTIES AUTOMOC OFF AUTORCC OFF diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix index 29461be5c5..0f69b6b487 100644 --- a/qmake/Makefile.unix +++ b/qmake/Makefile.unix @@ -17,7 +17,7 @@ OBJS = \ #qt code (please keep in order matching DEPEND_SRC) QOBJS = \ - qtextcodec.o qutfcodec.o \ + qutfcodec.o \ qendian.o qglobal.o qlogging.o qmalloc.o qnumeric.o qoperatingsystemversion.o qrandom.o \ qabstractfileengine.o qbuffer.o qdatastream.o qdebug.o \ qdir.o qdiriterator.o \ @@ -66,7 +66,6 @@ DEPEND_SRC = \ $(QMKGENSRC)/win32/msvc_vcxproj.cpp \ $(QMKGENSRC)/win32/winmakefile.cpp \ $(QMKGENSRC)/xmloutput.cpp \ - $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp \ $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp \ $(SOURCE_PATH)/src/corelib/global/qendian.cpp \ $(SOURCE_PATH)/src/corelib/global/qglobal.cpp \ @@ -193,6 +192,9 @@ qmakeevaluator.o: $(QMKLIBSRC)/qmakeevaluator.cpp qmakebuiltins.o: $(QMKLIBSRC)/qmakebuiltins.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< +registry.o: $(QMKLIBSRC)/registry.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + project.o: $(QMKSRC)/project.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< @@ -226,9 +228,6 @@ unixmake.o: $(QMKSRC)/generators/unix/unixmake.cpp unixmake2.o: $(QMKSRC)/generators/unix/unixmake2.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< -registry.o: $(QMKSRC)/generators/win32/registry.cpp - $(CXX) -c -o $@ $(CXXFLAGS) $< - winmakefile.o: $(QMKSRC)/generators/win32/winmakefile.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< @@ -341,9 +340,6 @@ qcore_foundation.o: $(SOURCE_PATH)/src/corelib/kernel/qcore_foundation.mm qutfcodec.o: $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< -qtextcodec.o: $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp - $(CXX) -c -o $@ $(CXXFLAGS) $< - qstring.o: $(SOURCE_PATH)/src/corelib/tools/qstring.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< diff --git a/qmake/Makefile.unix.win32 b/qmake/Makefile.unix.win32 index 48efd6f030..faf09ac11e 100644 --- a/qmake/Makefile.unix.win32 +++ b/qmake/Makefile.unix.win32 @@ -18,4 +18,4 @@ QTSRCS = \ $(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp \ $(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp \ $(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp \ - $(SOURCE_PATH)/qmake/generators/win32/registry.cpp + $(SOURCE_PATH)/qmake/library/registry.cpp diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index a1699bd6f8..6ab40c6765 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -12,11 +12,11 @@ QMKSRC = $(SOURCE_PATH)\qmake # !if "$(QMAKESPEC)" == "win32-icc" CXX = icl -LINKER = link -CFLAGS_EXTRA = /Zc:forScope /Qstd=c++11 +LINKER = xilink +CFLAGS_EXTRA = /Zc:forScope /Qstd=c++11 /O3 !elseif "$(QMAKESPEC)" == "win32-clang-msvc" CXX = clang-cl -LINKER = link +LINKER = lld-link CFLAGS_EXTRA = -fms-compatibility-version=19.00.23506 -Wno-microsoft-enum-value !else CXX = cl @@ -24,13 +24,11 @@ LINKER = link CFLAGS_EXTRA = /MP /wd4577 $(CFLAGS_CRT) !endif # !win32-icc -!if "$(QMAKESPEC)" != "win32-clang-msvc" CFLAGS_PCH = -Yuqmake_pch.h -FIqmake_pch.h -Fpqmake_pch.pch PCH_OBJECT = qmake_pch.obj -!endif CFLAGS_BARE = -c -Fo./ -Fdqmake.pdb \ - -W2 -nologo -O1 \ + -W2 -nologo -O2 \ $(CFLAGS_EXTRA) \ -I$(QMKSRC) -I$(QMKSRC)\library -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac \ -I$(INC_PATH) -I$(INC_PATH)\QtCore -I$(INC_PATH)\QtCore\$(QT_VERSION) -I$(INC_PATH)\QtCore\$(QT_VERSION)\QtCore \ @@ -100,7 +98,6 @@ QTOBJS= \ qoperatingsystemversion.obj \ qoperatingsystemversion_win.obj \ qregexp.obj \ - qtextcodec.obj \ qutfcodec.obj \ qstring.obj \ qstring_compat.obj \ diff --git a/qmake/doc/qmake.qdocconf b/qmake/doc/qmake.qdocconf index 3493a697f4..cf8f911372 100644 --- a/qmake/doc/qmake.qdocconf +++ b/qmake/doc/qmake.qdocconf @@ -25,6 +25,8 @@ sources = src/qmake-manual.qdoc imagedirs = images exampledirs = snippets +tagfile = qmake.tags + depends += \ activeqt \ qt3d \ diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index 7fd9dd9623..aba5be61dd 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -973,6 +973,7 @@ \row \li c++1z \li C++17 support is enabled. This option has no effect if the compiler does not support C++17, or can't select the C++ standard. By default, support is disabled. + \row \li c++17 \li Same as c++1z. \row \li strict_c++ \li Disables support for C++ compiler extensions. By default, they are enabled. \row \li depend_includepath \li Appending the value of INCLUDEPATH to @@ -1059,8 +1060,12 @@ proper include paths, compiler flags and libraries will automatically be added to the project. \row \li console \li The target is a Win32 console application (app only). The - proper include paths, compiler flags and libraries will - automatically be added to the project. + proper include paths, compiler flags and libraries will automatically be + added to the project. Consider using the option \c{cmdline} for + cross-platform applications. + \row \li cmdline \li The target is a cross-platform command line application. + On Windows, this implies \c{CONFIG += console}. + On macOS, this implies \c{CONFIG -= app_bundle}. \row \li shared \li{1,2} The target is a shared object/DLL. The proper include paths, compiler flags and libraries will automatically be added to the project. Note that \c dll can also be used on all platforms; @@ -2787,6 +2792,26 @@ See also \l{#DEPENDPATH}{DEPENDPATH}. + \target WINDOWS_TARGET_PLATFORM_VERSION + \section1 WINDOWS_TARGET_PLATFORM_VERSION + + Specifies the targeted Windows version; this corresponds to the tag + \c{WindowsTargetPlatformVersion} in vcxproj files. + + On desktop Windows, the default value is the value of the environment + variable \c{WindowsSDKVersion}. + + On WinRT, the default value is the value of the environment variable + \c{UCRTVERSION}. + + \target WINDOWS_TARGET_PLATFORM_MIN_VERSION + \section1 WINDOWS_TARGET_PLATFORM_MIN_VERSION + + Specifies the minimum version of the Windows target platform; this + corresponds to the tag \c{WindowsTargetPlatformMinVersion} in vcxproj files. + + Defaults to \c{WINDOWS_TARGET_PLATFORM_VERSION}. + \target WINRT_MANIFEST \section1 WINRT_MANIFEST @@ -2920,10 +2945,12 @@ \li The version number of the package. Defaults to \c{1.0.0.0}. \row \li minVersion - \li The minimum required Windows version to run the package. Defaults to the environment variable \c UCRTVersion. + \li The minimum required Windows version to run the package. + Defaults to \c{WINDOWS_TARGET_PLATFORM_VERSION}. \row \li maxVersionTested - \li The maximum Windows version the package has been tested against. Defaults to \c WINRT_MANIFEST.minVersion + \li The maximum Windows version the package has been tested against. + Defaults to \c{WINDOWS_TARGET_PLATFORM_MIN_VERSION}. \endtable @@ -3026,6 +3053,8 @@ \snippet code/doc_src_qmake-manual.pro 159 + This function was introduced in Qt 5.0. + See also \l{clean_path(path)}{clean_path()}, \l{relative_path(filePath[, base])}{relative_path()}. @@ -3037,6 +3066,7 @@ \snippet code/doc_src_qmake-manual.pro 59 + \target qmake-cat \section2 cat(filename[, mode]) Returns the contents of \c filename. You can specify the following options @@ -3059,6 +3089,8 @@ redundant ones removed, and "."s and ".."s resolved (as far as possible). This function is a wrapper around QDir::cleanPath. + This function was introduced in Qt 5.0. + See also \l{absolute_path(path[, base])}{absolute_path()}, \l{relative_path(filePath[, base])}{relative_path()}, \l{shell_path(path)}{shell_path()}, \l{system_path(path)}{system_path()}. @@ -3073,6 +3105,8 @@ Returns a list of all defined variable names. + This function was introduced in Qt 5.0. + \section2 escape_expand(arg1 [, arg2 ..., argn]) Accepts an arbitrary number of arguments. It expands the @@ -3136,6 +3170,8 @@ \snippet code/doc_src_qmake-manual.pro 163 + This function was introduced in Qt 5.0. + \section2 fromfile(filename, variablename) Evaluates \c filename as a qmake project file and returns the value assigned @@ -3150,6 +3186,8 @@ The \c getenv function, however, supports environment variables with parentheses in their name. + This function was introduced in Qt 5.12. + \section2 join(variablename, glue, before, after) Joins the value of \c variablename with \c glue. If this value is @@ -3239,6 +3277,8 @@ sum = $$num_add($$first, $$second_neg) \endcode + This function was introduced in Qt 5.8. + \section2 prompt(question [, decorate]) Displays the specified \c question, and returns a value read from stdin. @@ -3256,6 +3296,19 @@ Returns the \c string with every special regular expression character escaped with a backslash. This function is a wrapper around QRegExp::escape. + \section2 read_registry(tree, key[, flag]) + + Returns the value of registry key \c key inside the tree \c tree. + + Only the trees \c HKEY_CURRENT_USER (\c HKCU) and \c HKEY_LOCAL_MACHINE + (\c HKLM) are supported. + + The \c flag may be \c WOW64_32KEY (\c 32) or \c WOW64_64KEY (\c 64). + + \note This function is available only on Windows hosts. + + This function was introduced in Qt 5.12.1. + \section2 relative_path(filePath[, base]) Returns the path to \c filePath relative to \c base. @@ -3268,6 +3321,8 @@ directory; in that case, this function effectively acts as $$clean_path(). + This function was introduced in Qt 5.0. + See also \l{absolute_path(path[, base])}{absolute_path()}, \l{clean_path(path)}{clean_path()}. @@ -3287,10 +3342,14 @@ This is an internal function that you will typically not need. + This function was introduced in Qt 5.0. + \section2 reverse(variablename) Returns the values of \c variablename in reverse order. + This function was introduced in Qt 5.0. + \section2 section(variablename, separator, begin, end) Returns a section of the value of \c variablename. This function is a @@ -3306,6 +3365,8 @@ This function returns \c path for in-source builds. It returns an empty string if \c path points outside of the source tree. + This function was introduced in Qt 5.0. + \section2 shell_path(path) Converts all directory separators within \c path to separators that are @@ -3313,12 +3374,16 @@ the shell that is invoked by the make tool). For example, slashes are converted to backslashes when the Windows shell is used. + This function was introduced in Qt 5.0. + See also \l{system_path(path)}{system_path()}. \section2 shell_quote(arg) Quotes \c arg for the shell that is used while building the project. + This function was introduced in Qt 5.0. + See also \l{system_quote(arg)}{system_quote()}. \target fn_size @@ -3332,6 +3397,8 @@ This is an internal function that you will typically not need. + This function was introduced in Qt 5.0. + \section2 sorted(variablename) Returns the list of values in \c variablename with entries sorted @@ -3340,6 +3407,8 @@ Numerical sorting can be accomplished by zero-padding the values to a fixed length with the help of the \l{format_number()} function. + This function was introduced in Qt 5.8. + \section2 split(variablename, separator) Splits the value of \c variablename into separate values, and returns them @@ -3386,6 +3455,8 @@ See also \l{member()}, \l{num_add()}. + This function was introduced in Qt 5.8. + \target str_size() \section2 str_size(arg) @@ -3393,6 +3464,8 @@ See also \l{fn_size}{size()}. + This function was introduced in Qt 5.8. + \target system_replace \section2 system(command[, mode[, stsvar]]) @@ -3403,6 +3476,10 @@ \snippet code/doc_src_qmake-manual.pro 72 + Like \l {qmake-cat}{$$cat()}, the \a mode argument takes \c blob, \c lines, + \c true, and \c false as value. However, the legacy word splitting rules + (i.e. empty or \c true, and \c false) differ subtly. + If you pass \c stsvar, the command's exit status will be stored in that variable. If the command crashes, the status will be -1, otherwise a non-negative exit code of the command's choosing. Usually, comparing @@ -3417,6 +3494,8 @@ invoke commands. For example, slashes are converted to backslashes for the Windows shell. + This function was introduced in Qt 5.0. + See also \l{shell_path(path)}{shell_path()}. \section2 system_quote(arg) @@ -3424,6 +3503,8 @@ Quotes \c arg for the shell that is used by the \c{system()} functions. + This function was introduced in Qt 5.0. + See also \l{shell_quote(arg)}{shell_quote()}. \target take_first() @@ -3434,6 +3515,8 @@ This provides convenience for implementing queues, for example. + This function was introduced in Qt 5.8. + See also \l{take_last()}, \l{fn_first}{first()}. \target take_last() @@ -3444,6 +3527,8 @@ This provides convenience for implementing stacks, for example. + This function was introduced in Qt 5.8. + See also \l{take_first()}, \l{fn_last}{last()}. \target unique @@ -3464,6 +3549,8 @@ Escapes the values of \c variablename in a way that enables parsing them as qmake code. + + This function was introduced in Qt 5.0. */ /*! @@ -3487,6 +3574,8 @@ This is an internal function that you will typically not need. + This function was introduced in Qt 5.0. + \section2 CONFIG(config) This function can be used to test for variables placed into the @@ -3693,6 +3782,8 @@ Prints a message on the console. Unlike the \c message function, neither prepends text nor appends a line break. + This function was introduced in Qt 5.0. + See also \l{message(string)}{message()}. \section2 message(string) @@ -3718,6 +3809,8 @@ Creates the directory path \c dirPath. This function is a wrapper around the QDir::mkpath function. + This function was introduced in Qt 5.0. + \section2 requires(condition) Evaluates \c condition. If the condition is false, qmake skips this @@ -3744,6 +3837,8 @@ Updates the time stamp of \c filename to match the time stamp of \c reference_filename. + This function was introduced in Qt 5.0. + \section2 unset(variablename) Removes \c variablename from the current context. @@ -3760,12 +3855,16 @@ the string will be ignored. Comparison is performed segment-wise from left to right; if one version is a prefix of the other, it is considered smaller. + This function was introduced in Qt 5.10. + \section2 versionAtMost(variablename, versionNumber) Tests that the version number from \c variablename is less than or equal to \c versionNumber. Works as \l{versionAtLeast(variablename, versionNumber)}{versionAtLeast()}. + This function was introduced in Qt 5.10. + \section2 warning(string) Always succeeds, and displays \c string as a warning message to the user. @@ -3777,6 +3876,8 @@ an empty file. If \c mode is \c append and the file already exists, appends to it instead of replacing it. + This function was introduced in Qt 5.0. + \section1 Test Function Library Complex test functions are implemented in a library of .prf files. @@ -3823,6 +3924,8 @@ \snippet code/doc_src_qmake-manual.pro 178 + This function was introduced in Qt 5.0. + \section2 qtCompileTest(test) Builds a test project. If the test passes, true is returned and @@ -3863,10 +3966,14 @@ See also \l{load(feature)}{load()}. + This function was introduced in Qt 5.0. + \section2 qtHaveModule(name) Checks whether the Qt module specified by \c name is present. For a list of possible values, see \l{Variables#QT}{QT}. + + This function was introduced in Qt 5.0.1. */ /*! @@ -4870,8 +4977,7 @@ \code TEMPLATE = app LANGUAGE = C++ - CONFIG += console precompile_header - CONFIG -= app_bundle + CONFIG += cmdline precompile_header # Use Precompiled headers (PCH) PRECOMPILED_HEADER = stable.h diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 5407ed6c69..07832041a7 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -856,7 +856,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) QString lib_file = QMakeMetaInfo::checkLib(Option::normalizePath( (*lit) + Option::dir_sep + lib + Option::prl_ext)); if (!lib_file.isEmpty()) { - QMakeMetaInfo libinfo(project); + QMakeMetaInfo libinfo; if(libinfo.readLib(lib_file)) { if(!libinfo.isEmpty("QMAKE_PRL_TARGET")) { library = (*lit) + Option::dir_sep + libinfo.first("QMAKE_PRL_TARGET"); diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index e41e391cad..b634ec622b 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -81,8 +81,8 @@ bool MakefileGenerator::canExecute(const QStringList &cmdline, int *a) const QString MakefileGenerator::mkdir_p_asstring(const QString &dir, bool escape) const { - QString edir = escape ? escapeFilePath(Option::fixPathToTargetOS(dir, false, false)) : dir; - return "@" + makedir.arg(edir); + return "@" + makedir.arg( + escape ? escapeFilePath(Option::fixPathToTargetOS(dir, false, false)) : dir); } bool MakefileGenerator::mkdir(const QString &in_path) const @@ -424,6 +424,9 @@ MakefileGenerator::init() } incs.append(project->specDir()); + const auto platform = v["QMAKE_PLATFORM"]; + resolveDependenciesInFrameworks = platform.contains("darwin"); + const char * const cacheKeys[] = { "_QMAKE_STASH_", "_QMAKE_SUPER_CACHE_", nullptr }; for (int i = 0; cacheKeys[i]; ++i) { if (v[cacheKeys[i]].isEmpty()) @@ -529,7 +532,7 @@ MakefileGenerator::init() QStack<int> state; enum { IN_CONDITION, MET_CONDITION, PENDING_CONDITION }; for (int count = 1; !in.atEnd(); ++count) { - QString line = QString::fromUtf8(in.readLine()); + QString line = QString::fromLatin1(in.readLine()); if (line.startsWith("!!IF ")) { if (state.isEmpty() || state.top() == IN_CONDITION) { QString test = line.mid(5, line.length()-(5+1)); @@ -575,7 +578,7 @@ MakefileGenerator::init() contents += project->expand(line, in.fileName(), count); } } - contentBytes = contents.toUtf8(); + contentBytes = contents.toLatin1(); } QFile out(outn); QFileInfo outfi(out); @@ -624,7 +627,7 @@ MakefileGenerator::init() compiler.flags |= Compiler::CompilerNoCheckDeps; compilers.append(compiler); } - for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) { + for (ProStringList::ConstIterator it = quc.cbegin(); it != quc.cend(); ++it) { const ProStringList &inputs = v[ProKey(*it + ".input")]; for(x = 0; x < inputs.size(); ++x) { Compiler compiler; @@ -909,7 +912,7 @@ MakefileGenerator::processPrlFileCore(QString &origFile, const QStringRef &origN const QString meta_file = QMakeMetaInfo::checkLib(fixedFile); if (meta_file.isEmpty()) return false; - QMakeMetaInfo libinfo(project); + QMakeMetaInfo libinfo; debug_msg(1, "Processing PRL file: %s", meta_file.toLatin1().constData()); if (!libinfo.readLib(meta_file)) { fprintf(stderr, "Error processing meta file %s\n", meta_file.toLatin1().constData()); @@ -1101,8 +1104,6 @@ QString MakefileGenerator::prlFileName(bool fixify) { QString ret = project->first("PRL_TARGET") + Option::prl_ext; - if(!project->isEmpty("QMAKE_BUNDLE")) - ret.prepend(project->first("QMAKE_BUNDLE") + Option::dir_sep); if(fixify) { if(!project->isEmpty("DESTDIR")) ret.prepend(project->first("DESTDIR").toQString()); @@ -1291,6 +1292,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild) } } bool is_target = (wild == fileFixify(var("TARGET"), FileFixifyAbsolute)); + const bool noStrip = installConfigValues.contains("nostrip"); if(is_target || exists(wild)) { //real file or target QFileInfo fi(fileInfo(wild)); QString dst_file = filePrefixRoot(root, dst_dir); @@ -1304,7 +1306,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild) cmd = QLatin1String("-$(QINSTALL)"); cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file); inst << cmd; - if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") && + if (!noStrip && !project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") && !fi.isDir() && fi.isExecutable() && !project->isEmpty("QMAKE_STRIP")) inst << QString("-") + var("QMAKE_STRIP") + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst_dir + filestr, FileFixifyAbsolute, false))); @@ -1339,7 +1341,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild) QString cmd = QLatin1String("-$(QINSTALL) ") + escapeFilePath(dirstr + file) + " " + escapeFilePath(dst_file); inst << cmd; - if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") && + if (!noStrip && !project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") && !fi.isDir() && fi.isExecutable() && !project->isEmpty("QMAKE_STRIP")) inst << QString("-") + var("QMAKE_STRIP") + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst_dir + file, FileFixifyAbsolute, false))); @@ -1840,6 +1842,33 @@ static QStringList splitDeps(const QString &indeps, bool lineMode) return deps; } +QString MakefileGenerator::resolveDependency(const QDir &outDir, const QString &file) +{ + const QList<QMakeLocalFileName> &depdirs = QMakeSourceFileInfo::dependencyPaths(); + for (const auto &depdir : depdirs) { + const QString &local = depdir.local(); + QString lf = outDir.absoluteFilePath(local + '/' + file); + if (exists(lf)) + return lf; + + if (resolveDependenciesInFrameworks) { + // Given a file like "QtWidgets/QWidget", try to resolve it + // as framework header "QtWidgets.framework/Headers/QWidget". + int cut = file.indexOf('/'); + if (cut < 0 || cut + 1 >= file.size()) + continue; + QStringRef framework = file.leftRef(cut); + QStringRef include = file.midRef(cut + 1); + if (local.endsWith('/' + framework + ".framework/Headers")) { + lf = outDir.absoluteFilePath(local + '/' + include); + if (exists(lf)) + return lf; + } + } + } + return {}; +} + void MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) { @@ -1877,12 +1906,14 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) if (config.indexOf("combine") != -1) { // compilers with a combined input only have one output QString input = project->first(ProKey(*it + ".output")).toQString(); - t << ' ' << escapeDependencyPath(Option::fixPathToTargetOS( - replaceExtraCompilerVariables(tmp_out, input, QString(), NoShell))); + t << ' ' << escapeDependencyPath(fileFixify( + replaceExtraCompilerVariables(tmp_out, input, QString(), NoShell), + FileFixifyFromOutdir)); } else { - for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { - t << ' ' << escapeDependencyPath(Option::fixPathToTargetOS( - replaceExtraCompilerVariables(tmp_out, (*input).toQString(), QString(), NoShell))); + for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) { + t << ' ' << escapeDependencyPath(fileFixify( + replaceExtraCompilerVariables(tmp_out, (*input).toQString(), QString(), NoShell), + FileFixifyFromOutdir)); } } t << endl; @@ -1914,12 +1945,13 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) const QString del_statement("-$(DEL_FILE)"); if(!wrote_clean) { QStringList dels; - for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { + for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) { QString tinp = (*input).toQString(); QString out = replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell); for (const QString &rc : qAsConst(raw_clean)) { - dels << ' ' + escapeFilePath(Option::fixPathToTargetOS( - replaceExtraCompilerVariables(rc, tinp, out, NoShell), false)); + dels << ' ' + escapeFilePath(fileFixify( + replaceExtraCompilerVariables(rc, tinp, out, NoShell), + FileFixifyFromOutdir)); } } if(project->isActiveConfig("no_delete_multiple_files")) { @@ -1942,7 +1974,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) if(!cleans.isEmpty()) t << valGlue(cleans, "\n\t" + del_statement, "\n\t" + del_statement, ""); if(!wrote_clean_cmds) { - for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { + for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) { QString tinp = (*input).toQString(); t << "\n\t" << replaceExtraCompilerVariables(tmp_clean_cmds, tinp, replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell), TargetShell); @@ -1961,7 +1993,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) QStringList deps, inputs; if(!tmp_dep.isEmpty()) deps += fileFixify(tmp_dep, FileFixifyFromOutdir); - for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { + for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) { QString inpf = (*input).toQString(); deps += findDependencies(inpf); inputs += Option::fixPathToTargetOS(inpf, false); @@ -1989,16 +2021,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) } else if (exists(absFile)) { file = absFile; } else { - QString localFile; - QList<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths(); - for (QList<QMakeLocalFileName>::Iterator dit = depdirs.begin(); - dit != depdirs.end(); ++dit) { - QString lf = outDir.absoluteFilePath((*dit).local() + '/' + file); - if (exists(lf)) { - localFile = lf; - break; - } - } + QString localFile = resolveDependency(outDir, file); if (localFile.isEmpty()) { if (exists(file)) warn_msg(WarnDeprecated, ".depend_command for extra compiler %s" @@ -2035,7 +2058,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) QString out = replaceExtraCompilerVariables(tmp_out, QString(), QString(), NoShell); QString cmd = replaceExtraCompilerVariables(tmp_cmd, inputs, QStringList() << out, TargetShell); - t << escapeDependencyPath(Option::fixPathToTargetOS(out)) << ":"; + t << escapeDependencyPath(fileFixify(out, FileFixifyFromOutdir)) << ":"; // compiler.CONFIG+=explicit_dependencies means that ONLY compiler.depends gets to cause Makefile dependencies if (config.indexOf("explicit_dependencies") != -1) { t << " " << valList(escapeDependencyPaths(fileFixify(tmp_dep, FileFixifyFromOutdir))); @@ -2045,16 +2068,18 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) t << "\n\t" << cmd << endl << endl; continue; } - for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { + for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) { QString inpf = (*input).toQString(); - QString in = Option::fixPathToTargetOS(inpf, false); - QStringList deps = findDependencies(inpf); - deps << in; - QString out = Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, inpf, QString(), NoShell)); + QStringList deps; + deps << fileFixify(inpf, FileFixifyFromOutdir); + deps += findDependencies(inpf); + QString out = fileFixify(replaceExtraCompilerVariables(tmp_out, inpf, QString(), NoShell), + FileFixifyFromOutdir); if(!tmp_dep.isEmpty()) { QStringList pre_deps = fileFixify(tmp_dep, FileFixifyFromOutdir); for(int i = 0; i < pre_deps.size(); ++i) - deps << replaceExtraCompilerVariables(pre_deps.at(i), inpf, out, NoShell); + deps << fileFixify(replaceExtraCompilerVariables(pre_deps.at(i), inpf, out, NoShell), + FileFixifyFromOutdir); } QString cmd = replaceExtraCompilerVariables(tmp_cmd, inpf, out, TargetShell); // NOTE: The var -> QMAKE_COMP_var replace feature is unsupported, do not use! @@ -2084,16 +2109,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) } else if (exists(absFile)) { file = absFile; } else { - QString localFile; - QList<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths(); - for (QList<QMakeLocalFileName>::Iterator dit = depdirs.begin(); - dit != depdirs.end(); ++dit) { - QString lf = outDir.absoluteFilePath((*dit).local() + '/' + file); - if (exists(lf)) { - localFile = lf; - break; - } - } + QString localFile = resolveDependency(outDir, file); if (localFile.isEmpty()) { if (exists(file)) warn_msg(WarnDeprecated, ".depend_command for extra compiler %s" @@ -2114,7 +2130,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) //use the depend system to find includes of these included files QStringList inc_deps; for(int i = 0; i < deps.size(); ++i) { - const QString dep = deps.at(i); + const QString dep = fileFixify(deps.at(i), FileFixifyFromOutdir | FileFixifyAbsolute); if(QFile::exists(dep)) { SourceFileType type = TYPE_UNKNOWN; if(type == TYPE_UNKNOWN) { @@ -2151,11 +2167,10 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) } } } - deps += inc_deps; + deps += fileFixify(inc_deps, FileFixifyFromOutdir); } for(int i = 0; i < deps.size(); ) { QString &dep = deps[i]; - dep = Option::fixPathToTargetOS(dep, false); if(out == dep) deps.removeAt(i); else @@ -2209,6 +2224,25 @@ MakefileGenerator::writeExtraVariables(QTextStream &t) } } +// This is a more powerful alternative to the above function. +// It's meant to be internal, as one can make quite a mess with it. +void +MakefileGenerator::writeExportedVariables(QTextStream &t) +{ + const auto &vars = project->values("QMAKE_EXPORTED_VARIABLES"); + if (vars.isEmpty()) + return; + for (const auto &exp : vars) { + const ProString &name = project->first(ProKey(exp + ".name")); + const ProString &value = project->first(ProKey(exp + ".value")); + if (!value.isEmpty()) + t << name << " = " << value << endl; + else + t << name << " =\n"; + } + t << endl; +} + bool MakefileGenerator::writeDummyMakefile(QTextStream &t) { @@ -2327,6 +2361,7 @@ MakefileGenerator::writeHeader(QTextStream &t) if (ofile.lastIndexOf(Option::dir_sep) != -1) ofile.remove(0, ofile.lastIndexOf(Option::dir_sep) +1); t << "MAKEFILE = " << escapeFilePath(ofile) << endl << endl; + t << "EQ = =\n\n"; } QList<MakefileGenerator::SubTarget*> @@ -2550,6 +2585,9 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT { //actually compile t << subtarget->target << ":"; + auto extraDeps = extraSubTargetDependencies(); + if (!extraDeps.isEmpty()) + t << " " << valList(extraDeps); if(!subtarget->depends.isEmpty()) t << " " << valList(subtarget->depends); t << " FORCE"; @@ -2871,6 +2909,7 @@ MakefileGenerator::escapeDependencyPath(const QString &path) const static const QRegExp criticalChars(QStringLiteral("([\t #])")); #endif ret.replace(criticalChars, QStringLiteral("\\\\1")); + ret.replace(QLatin1Char('='), QStringLiteral("$(EQ)")); debug_msg(2, "escapeDependencyPath: %s -> %s", path.toLatin1().constData(), ret.toLatin1().constData()); } return ret; @@ -3352,7 +3391,7 @@ MakefileGenerator::writePkgConfigFile() libs << "QMAKE_LIBS_PRIVATE"; libs << "QMAKE_LFLAGS_THREAD"; //not sure about this one, but what about things like -pthread? t << "Libs.private:"; - for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it) + for (ProStringList::ConstIterator it = libs.cbegin(); it != libs.cend(); ++it) t << ' ' << fixLibFlags((*it).toKey()).join(' '); t << endl; } diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index b5c150e1cb..350ebd377a 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -55,6 +55,7 @@ class MakefileGenerator : protected QMakeSourceFileInfo { QString spec; bool no_io; + bool resolveDependenciesInFrameworks = false; QHash<QString, bool> init_compiler_already; QString makedir, chkexists; QString build_args(); @@ -79,8 +80,10 @@ protected: void writeHeader(QTextStream &t); void writeSubDirs(QTextStream &t); void writeMakeQmake(QTextStream &t, bool noDummyQmakeAll = false); + void writeExportedVariables(QTextStream &t); void writeExtraVariables(QTextStream &t); void writeExtraTargets(QTextStream &t); + QString resolveDependency(const QDir &outDir, const QString &file); void writeExtraCompilerTargets(QTextStream &t); void writeExtraCompilerVariables(QTextStream &t); bool writeDummyMakefile(QTextStream &t); @@ -116,6 +119,7 @@ protected: virtual void writeSubMakeCall(QTextStream &t, const QString &outDirectory_cdin, const QString &makeFileIn); virtual void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags); + virtual ProStringList extraSubTargetDependencies() { return {}; } //extra compiler interface bool verifyExtraCompiler(const ProString &c, const QString &f); diff --git a/qmake/generators/projectgenerator.cpp b/qmake/generators/projectgenerator.cpp index f45a90b851..ef34955eb1 100644 --- a/qmake/generators/projectgenerator.cpp +++ b/qmake/generators/projectgenerator.cpp @@ -345,14 +345,10 @@ ProjectGenerator::writeMakefile(QTextStream &t) << getWritableVar("CONFIG_REMOVE", false) << getWritableVar("INCLUDEPATH") << endl; - t << "# The following define makes your compiler warn you if you use any\n" - "# feature of Qt which has been marked as deprecated (the exact warnings\n" - "# depend on your compiler). Please consult the documentation of the\n" - "# deprecated API in order to know how to port your code away from it.\n" - "DEFINES += QT_DEPRECATED_WARNINGS\n" - "\n" - "# You can also make your code fail to compile if you use deprecated APIs.\n" + t << "# You can make your code fail to compile if you use deprecated APIs.\n" "# In order to do so, uncomment the following line.\n" + "# Please consult the documentation of the deprecated API in order to know\n" + "# how to port your code away from it.\n" "# You can also select to disable deprecated APIs only up to a certain version of Qt.\n" "#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0\n\n"; diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 50ec8db79e..7f42fbe09e 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -399,6 +399,8 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) libdirs.append(QMakeLocalFileName(dlib.toQString())); frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks")); frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks")); + ProStringList extens; + extens << project->first("QMAKE_EXTENSION_SHLIB") << "a"; static const char * const lflags[] = { "LIBS", "LIBS_PRIVATE", "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", nullptr }; for (int i = 0; lflags[i]; i++) { @@ -417,8 +419,6 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) libdirs.insert(libidx++, f); } else if(opt.startsWith("-l")) { QString lib = opt.mid(2); - ProStringList extens; - extens << project->first("QMAKE_EXTENSION_SHLIB") << "a"; for (QList<QMakeLocalFileName>::Iterator dep_it = libdirs.begin(); dep_it != libdirs.end(); ++dep_it) { QString libBase = (*dep_it).local() + '/' @@ -506,23 +506,30 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) if (opt.startsWith("-Xarch")) opt = l.at(++lit); // The user has done the right thing and prefixed each part } - bool found = false; for(int x = 0; x < lflags[arch].size(); ++x) { if (lflags[arch].at(x) == "-framework" && lflags[arch].at(++x) == opt) { - found = true; + lflags[arch].remove(x - 1, 2); break; } } - if(!found) { - lflags[arch].append("-framework"); - lflags[arch].append(opt); - } + lflags[arch].append("-framework"); + lflags[arch].append(opt); } else { lflags[arch].append(opt); } } else if(!opt.isNull()) { + for (const ProString &ext : extens) { + if (opt.size() > ext.size() && opt.endsWith(ext) + && opt.at(opt.size() - ext.size() - 1) == '.') { + // Make sure we keep the dependency order of libraries + lflags[arch].removeAll(opt); + lflags[arch].append(opt); + goto found2; + } + } if(!lflags[arch].contains(opt)) lflags[arch].append(opt); + found2: ; } } diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 976751b02c..7d8c70ec3b 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -180,6 +180,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) ProStringList &bundledFiles = project->values("QMAKE_BUNDLED_FILES"); + writeExportedVariables(t); + t << "####### Compiler, tools and options\n\n"; t << "CC = " << var("QMAKE_CC") << endl; t << "CXX = " << var("QMAKE_CXX") << endl; @@ -405,7 +407,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) const ProStringList &l = project->values("QMAKE_PRL_INTERNAL_FILES"); ProStringList::ConstIterator it; for(it = l.begin(); it != l.end(); ++it) { - QMakeMetaInfo libinfo(project); + QMakeMetaInfo libinfo; if (libinfo.readLib((*it).toQString()) && !libinfo.isEmpty("QMAKE_PRL_BUILD_DIR")) { ProString dir; int slsh = (*it).lastIndexOf(Option::dir_sep); @@ -1225,6 +1227,8 @@ void UnixMakefileGenerator::init2() else ar_cmd.append("$(AR) $(TARGETA) $(OBJECTS)"); if (!project->isEmpty("QMAKE_BUNDLE")) { + project->values("PRL_TARGET").prepend( + project->first("QMAKE_BUNDLE") + Option::dir_sep + project->first("TARGET")); ProString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION"); if(!bundle_loc.isEmpty() && !bundle_loc.startsWith("/")) bundle_loc.prepend("/"); @@ -1483,7 +1487,7 @@ UnixMakefileGenerator::writeLibtoolFile() ProStringList libs; libs << "LIBS" << "QMAKE_LIBS"; t << "dependency_libs='"; - for (ProStringList::ConstIterator it = libs.begin(); it != libs.end(); ++it) + for (ProStringList::ConstIterator it = libs.cbegin(); it != libs.cend(); ++it) t << fixLibFlags((*it).toKey()).join(' ') << ' '; t << "'\n\n"; diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index ad2976aa01..0e95766f8e 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -34,7 +34,6 @@ #include <qscopedpointer.h> #include <qstringlist.h> #include <qfileinfo.h> -#include <qversionnumber.h> QT_BEGIN_NAMESPACE @@ -625,31 +624,17 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool) << tagValue("RootNamespace", tool.Name) << tagValue("Keyword", tool.Keyword); - QString windowsTargetPlatformVersion; if (isWinRT) { xml << tagValue("MinimumVisualStudioVersion", tool.Version) << tagValue("DefaultLanguage", "en") << tagValue("AppContainerApplication", "true") << tagValue("ApplicationType", "Windows Store") << tagValue("ApplicationTypeRevision", tool.SdkVersion); - if (tool.SdkVersion == "10.0") - windowsTargetPlatformVersion = qgetenv("UCRTVERSION"); - } else { - QByteArray winSDKVersionStr = qgetenv("WindowsSDKVersion").trimmed(); - - // This environment variable might end with a backslash due to a VS bug. - if (winSDKVersionStr.endsWith('\\')) - winSDKVersionStr.chop(1); - - QVersionNumber winSDKVersion = QVersionNumber::fromString( - QString::fromLocal8Bit(winSDKVersionStr)); - if (!winSDKVersion.isNull()) - windowsTargetPlatformVersion = winSDKVersionStr; - } - if (!windowsTargetPlatformVersion.isEmpty()) { - xml << tagValue("WindowsTargetPlatformVersion", windowsTargetPlatformVersion) - << tagValue("WindowsTargetPlatformMinVersion", windowsTargetPlatformVersion); } + if (!tool.WindowsTargetPlatformVersion.isEmpty()) + xml << tagValue("WindowsTargetPlatformVersion", tool.WindowsTargetPlatformVersion); + if (!tool.WindowsTargetPlatformMinVersion.isEmpty()) + xml << tagValue("WindowsTargetPlatformMinVersion", tool.WindowsTargetPlatformMinVersion); xml << closetag(); diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index f2cd7c633b..63d89a5388 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -34,23 +34,10 @@ #include <qdiriterator.h> #include <qset.h> -#include <registry_p.h> - #include <time.h> QT_BEGIN_NAMESPACE -static QString nmakePathList(const QStringList &list) -{ - QStringList pathList; - pathList.reserve(list.size()); - for (const QString &path : list) - pathList.append(QDir::cleanPath(path)); - - return QDir::toNativeSeparators(pathList.join(QLatin1Char(';'))) - .replace('#', QLatin1String("^#")).replace('$', QLatin1String("$$")); -} - NmakeMakefileGenerator::NmakeMakefileGenerator() : usePCH(false), usePCHC(false) { @@ -70,180 +57,6 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t) if(Option::mkfile::do_stub_makefile) return MakefileGenerator::writeStubMakefile(t); #endif - if (!project->isHostBuild()) { - if (project->isActiveConfig(QStringLiteral("winrt"))) { - QString arch = project->first("VCPROJ_ARCH").toQString().toLower(); - QString compiler; - QString compilerArch; - const QString msvcVer = project->first("MSVC_VER").toQString(); - if (msvcVer.isEmpty()) { - fprintf(stderr, "Mkspec does not specify MSVC_VER. Cannot continue.\n"); - return false; - } - - if (msvcVer == QStringLiteral("15.0")) { - const ProStringList hostArch = project->values("QMAKE_TARGET.arch"); - if (hostArch.contains("x86_64")) - compiler = QStringLiteral("HostX64/"); - else - compiler = QStringLiteral("HostX86/"); - if (arch == QLatin1String("arm")) { - compiler += QStringLiteral("arm"); - compilerArch = QStringLiteral("arm"); - } else if (arch == QLatin1String("x64")) { - compiler += QStringLiteral("x64"); - compilerArch = QStringLiteral("amd64"); - } else { - arch = QStringLiteral("x86"); - compiler += QStringLiteral("x86"); - } - } else { - if (arch == QLatin1String("arm")) { - compiler = QStringLiteral("x86_arm"); - compilerArch = QStringLiteral("arm"); - } else if (arch == QLatin1String("x64")) { - const ProStringList hostArch = project->values("QMAKE_TARGET.arch"); - if (hostArch.contains("x86_64")) - compiler = QStringLiteral("amd64"); - else - compiler = QStringLiteral("x86_amd64"); - compilerArch = QStringLiteral("amd64"); - } else { - arch = QStringLiteral("x86"); - } - } - - const QString winsdkVer = project->first("WINSDK_VER").toQString(); - if (winsdkVer.isEmpty()) { - fprintf(stderr, "Mkspec does not specify WINSDK_VER. Cannot continue.\n"); - return false; - } - const QString targetVer = project->first("WINTARGET_VER").toQString(); - if (targetVer.isEmpty()) { - fprintf(stderr, "Mkspec does not specify WINTARGET_VER. Cannot continue.\n"); - return false; - } - -#ifdef Q_OS_WIN - QString regKey; - if (msvcVer == QStringLiteral("15.0")) - regKey = QStringLiteral("Software\\Microsoft\\VisualStudio\\SxS\\VS7\\") + msvcVer; - else - regKey = QStringLiteral("Software\\Microsoft\\VisualStudio\\") + msvcVer + ("\\Setup\\VC\\ProductDir"); - const QString vcInstallDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey, KEY_WOW64_32KEY); - if (vcInstallDir.isEmpty()) { - fprintf(stderr, "Failed to find the Visual Studio installation directory.\n"); - return false; - } - - const QString windowsPath = "Software\\Microsoft\\Microsoft SDKs\\Windows\\v"; - - regKey = windowsPath + winsdkVer + QStringLiteral("\\InstallationFolder"); - const QString kitDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey, KEY_WOW64_32KEY); - if (kitDir.isEmpty()) { - fprintf(stderr, "Failed to find the Windows Kit installation directory.\n"); - return false; - } -#else - const QString vcInstallDir = "/fake/vc_install_dir"; - const QString kitDir = "/fake/sdk_install_dir"; -#endif // Q_OS_WIN - QStringList incDirs; - QStringList libDirs; - QStringList binDirs; - if (msvcVer == QStringLiteral("15.0")) { - const QString toolsInstallDir = qgetenv("VCToolsInstallDir"); - if (toolsInstallDir.isEmpty()) { - fprintf(stderr, "Failed to access tools installation dir.\n"); - return false; - } - - binDirs << toolsInstallDir + QStringLiteral("bin/") + compiler; - if (arch == QStringLiteral("x64")) - binDirs << toolsInstallDir + QStringLiteral("bin/HostX86/X86"); - binDirs << kitDir + QStringLiteral("bin/x86"); - binDirs << vcInstallDir + QStringLiteral("Common7/Tools"); - binDirs << vcInstallDir + QStringLiteral("Common7/ide"); - binDirs << vcInstallDir + QStringLiteral("MSBuild/15.0/bin"); - - incDirs << toolsInstallDir + QStringLiteral("include"); - incDirs << vcInstallDir + QStringLiteral("VC/Auxiliary/VS/include"); - - const QString crtVersion = qgetenv("UCRTVersion"); - if (crtVersion.isEmpty()) { - fprintf(stderr, "Failed to access CRT version.\n"); - return false; - } - const QString crtInclude = kitDir + QStringLiteral("Include/") + crtVersion; - const QString crtLib = kitDir + QStringLiteral("Lib/") + crtVersion; - incDirs << crtInclude + QStringLiteral("/ucrt"); - incDirs << crtInclude + QStringLiteral("/um"); - incDirs << crtInclude + QStringLiteral("/shared"); - incDirs << crtInclude + QStringLiteral("/winrt"); - - incDirs << kitDir + QStringLiteral("Extension SDKs/WindowsMobile/") - + crtVersion + QStringLiteral("/Include/WinRT"); - - libDirs << toolsInstallDir + QStringLiteral("lib/") + arch + QStringLiteral("/store"); - - libDirs << vcInstallDir + QStringLiteral("VC/Auxiliary/VS/lib/") + arch; - - libDirs << crtLib + QStringLiteral("/ucrt/") + arch; - libDirs << crtLib + QStringLiteral("/um/") + arch; - } else if (msvcVer == QStringLiteral("14.0")) { - binDirs << vcInstallDir + QStringLiteral("bin/") + compiler; - binDirs << vcInstallDir + QStringLiteral("bin/"); // Maybe remove for x86 again? - binDirs << kitDir + QStringLiteral("bin/") + (arch == QStringLiteral("arm") ? QStringLiteral("x86") : arch); - binDirs << vcInstallDir + QStringLiteral("../Common7/Tools/bin"); - binDirs << vcInstallDir + QStringLiteral("../Common7/Tools"); - binDirs << vcInstallDir + QStringLiteral("../Common7/ide"); - binDirs << kitDir + QStringLiteral("Windows Performance Toolkit/"); - - incDirs << vcInstallDir + QStringLiteral("include"); - incDirs << vcInstallDir + QStringLiteral("atlmfc/include"); - - const QString crtVersion = qgetenv("UCRTVersion"); - if (crtVersion.isEmpty()) { - fprintf(stderr, "Failed to access CRT version.\n"); - return false; - } - const QString crtInclude = kitDir + QStringLiteral("Include/") + crtVersion; - const QString crtLib = kitDir + QStringLiteral("Lib/") + crtVersion; - incDirs << crtInclude + QStringLiteral("/ucrt"); - incDirs << crtInclude + QStringLiteral("/um"); - incDirs << crtInclude + QStringLiteral("/shared"); - incDirs << crtInclude + QStringLiteral("/winrt"); - - incDirs << kitDir + QStringLiteral("Extension SDKs/WindowsMobile/") - + crtVersion + QStringLiteral("/Include/WinRT"); - - libDirs << vcInstallDir + QStringLiteral("lib/store/") + compilerArch; - libDirs << vcInstallDir + QStringLiteral("atlmfc/lib") + compilerArch; - - libDirs << crtLib + QStringLiteral("/ucrt/") + arch; - libDirs << crtLib + QStringLiteral("/um/") + arch; - } else { - incDirs << vcInstallDir + QStringLiteral("/include"); - libDirs << vcInstallDir + QStringLiteral("/lib/store/") + compilerArch - << vcInstallDir + QStringLiteral("/lib/") + compilerArch; - binDirs << vcInstallDir + QStringLiteral("/bin/") + compiler - << vcInstallDir + QStringLiteral("/../Common7/IDE"); - libDirs << kitDir + QStringLiteral("/Lib/") + targetVer + ("/um/") + arch; - incDirs << kitDir + QStringLiteral("/include/um") - << kitDir + QStringLiteral("/include/shared") - << kitDir + QStringLiteral("/include/winrt"); - } - - binDirs << vcInstallDir + QStringLiteral("/bin"); - - // Inherit PATH - binDirs << QString::fromLocal8Bit(qgetenv("PATH")).split(QLatin1Char(';')); - - t << "\nINCLUDE = " << nmakePathList(incDirs); - t << "\nLIB = " << nmakePathList(libDirs); - t << "\nPATH = " << nmakePathList(binDirs) << '\n'; - } - } writeNmakeParts(t); return MakefileGenerator::writeMakefile(t); } @@ -263,6 +76,11 @@ void NmakeMakefileGenerator::writeSubMakeCall(QTextStream &t, const QString &cal Win32MakefileGenerator::writeSubMakeCall(t, callPrefix, makeArguments); } +ProStringList NmakeMakefileGenerator::extraSubTargetDependencies() +{ + return { "$(MAKEFILE)" }; +} + QString NmakeMakefileGenerator::defaultInstall(const QString &t) { QString ret = Win32MakefileGenerator::defaultInstall(t); @@ -277,7 +95,9 @@ QString NmakeMakefileGenerator::defaultInstall(const QString &t) if (project->isActiveConfig("debug_info")) { if (t == "dlltarget" || project->values(ProKey(t + ".CONFIG")).indexOf("no_dll") == -1) { - QString pdb_target = project->first("TARGET") + project->first("TARGET_VERSION_EXT") + ".pdb"; + const QFileInfo targetFileInfo = project->first("DESTDIR") + project->first("TARGET") + + project->first("TARGET_EXT"); + const QString pdb_target = targetFileInfo.completeBaseName() + ".pdb"; QString src_targ = (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + pdb_target; QString dst_targ = filePrefixRoot(root, fileFixify(targetdir + pdb_target, FileFixifyAbsolute)); if(!ret.isEmpty()) @@ -345,21 +165,17 @@ QString NmakeMakefileGenerator::var(const ProKey &value) const || value == "QMAKE_RUN_CXX_IMP" || value == "QMAKE_RUN_CXX"); if ((isRunCpp && usePCH) || (isRunC && usePCHC)) { - QFileInfo precompHInfo(fileInfo(precompH)); - QString precompH_f = escapeFilePath(precompHInfo.fileName()); + QString precompH_f = escapeFilePath(fileFixify(precompH, FileFixifyBackwards)); QString precompRule = QString("-c -FI%1 -Yu%2 -Fp%3") .arg(precompH_f, precompH_f, escapeFilePath(isRunC ? precompPchC : precompPch)); + // ### For clang_cl 8 we force inline methods to be compiled here instead + // linking them from a pch.o file. We do this by pretending we are also doing + // the pch.o generation step. + if (project->isActiveConfig("clang_cl")) + precompRule += QString(" -Xclang -building-pch-with-obj"); QString p = MakefileGenerator::var(value); p.replace(QLatin1String("-c"), precompRule); - // Cannot use -Gm with -FI & -Yu, as this gives an - // internal compiler error, on the newer compilers - // ### work-around for a VS 2003 bug. Move to some prf file or remove completely. - p.remove("-Gm"); return p; - } else if (value == "QMAKE_CXXFLAGS") { - // Remove internal compiler error option - // ### work-around for a VS 2003 bug. Move to some prf file or remove completely. - return MakefileGenerator::var(value).remove("-Gm"); } } @@ -418,7 +234,10 @@ void NmakeMakefileGenerator::init() precompObj = var("PRECOMPILED_DIR") + project->first("TARGET") + "_pch" + Option::obj_ext; precompPch = var("PRECOMPILED_DIR") + project->first("TARGET") + "_pch.pch"; // Add linking of precompObj (required for whole precompiled classes) - project->values("OBJECTS") += precompObj; + // ### For clang_cl we currently let inline methods be generated in the normal objects, + // since the PCH object is buggy (as of clang 8.0.0) + if (!project->isActiveConfig("clang_cl")) + project->values("OBJECTS") += precompObj; // Add pch file to cleanup project->values("QMAKE_CLEAN") += precompPch; // Return to variable pool @@ -428,21 +247,23 @@ void NmakeMakefileGenerator::init() if (usePCHC) { precompObjC = var("PRECOMPILED_DIR") + project->first("TARGET") + "_pch_c" + Option::obj_ext; precompPchC = var("PRECOMPILED_DIR") + project->first("TARGET") + "_pch_c.pch"; - project->values("OBJECTS") += precompObjC; + if (!project->isActiveConfig("clang_cl")) + project->values("OBJECTS") += precompObjC; project->values("QMAKE_CLEAN") += precompPchC; project->values("PRECOMPILED_OBJECT_C") = ProStringList(precompObjC); project->values("PRECOMPILED_PCH_C") = ProStringList(precompPchC); } - ProString tgt = project->first("DESTDIR") - + project->first("TARGET") + project->first("TARGET_VERSION_EXT"); - if(project->isActiveConfig("shared")) { - project->values("QMAKE_CLEAN").append(tgt + ".exp"); - project->values("QMAKE_DISTCLEAN").append(tgt + ".lib"); + const QFileInfo targetFileInfo = project->first("DESTDIR") + project->first("TARGET") + + project->first("TARGET_EXT"); + const ProString targetBase = targetFileInfo.path() + '/' + targetFileInfo.completeBaseName(); + if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("shared")) { + project->values("QMAKE_CLEAN").append(targetBase + ".exp"); + project->values("QMAKE_DISTCLEAN").append(targetBase + ".lib"); } if (project->isActiveConfig("debug_info")) { QString pdbfile; - QString distPdbFile = tgt + ".pdb"; + QString distPdbFile = targetBase + ".pdb"; if (project->isActiveConfig("staticlib")) { // For static libraries, the compiler's pdb file and the dist pdb file are the same. pdbfile = distPdbFile; @@ -458,8 +279,8 @@ void NmakeMakefileGenerator::init() project->values("QMAKE_DISTCLEAN").append(distPdbFile); } if (project->isActiveConfig("debug")) { - project->values("QMAKE_CLEAN").append(tgt + ".ilk"); - project->values("QMAKE_CLEAN").append(tgt + ".idb"); + project->values("QMAKE_CLEAN").append(targetBase + ".ilk"); + project->values("QMAKE_CLEAN").append(targetBase + ".idb"); } else { ProStringList &defines = project->values("DEFINES"); if (!defines.contains("NDEBUG")) @@ -531,12 +352,13 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t) QDirIterator dit(sourceDir, sourceFilesFilter, QDir::Files | QDir::NoDotAndDotDot); while (dit.hasNext()) { dit.next(); - QString &duplicate = fileNames[dit.fileName()]; + const QFileInfo fi = dit.fileInfo(); + QString &duplicate = fileNames[fi.completeBaseName()]; if (duplicate.isNull()) { - duplicate = dit.filePath(); + duplicate = fi.filePath(); } else { warn_msg(WarnLogic, "%s conflicts with %s", qPrintable(duplicate), - qPrintable(dit.filePath())); + qPrintable(fi.filePath())); duplicatesFound = true; } } diff --git a/qmake/generators/win32/msvc_nmake.h b/qmake/generators/win32/msvc_nmake.h index 67a56c7813..5bfdba2bbc 100644 --- a/qmake/generators/win32/msvc_nmake.h +++ b/qmake/generators/win32/msvc_nmake.h @@ -48,6 +48,7 @@ class NmakeMakefileGenerator : public Win32MakefileGenerator protected: void writeSubMakeCall(QTextStream &t, const QString &callPrefix, const QString &makeArguments) override; + ProStringList extraSubTargetDependencies() override; QString defaultInstall(const QString &t) override; QStringList &findDependencies(const QString &file) override; QString var(const ProKey &value) const override; diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 4f0cee65e1..cf0b96ec9f 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -55,7 +55,8 @@ static DotNET vsVersionFromString(const char *versionString) { "11.0", NET2012 }, { "12.0", NET2013 }, { "14.0", NET2015 }, - { "15.0", NET2017 } + { "15.0", NET2017 }, + { "16.0", NET2019 } }; DotNET result = NETUnknown; for (const auto entry : mapping) { @@ -2213,8 +2214,49 @@ void VCFilter::addFiles(const ProStringList& fileList) void VCFilter::modifyPCHstage(QString str) { - bool autogenSourceFile = Project->autogenPrecompCPP; - bool pchThroughSourceFile = !Project->precompCPP.isEmpty(); + const bool isHFile = (str == Project->precompH); + const bool pchThroughSourceFile = !Project->precompSource.isEmpty(); + if (isHFile && pchThroughSourceFile && Project->autogenPrecompSource) { + useCustomBuildTool = true; + QString toFile(Project->precompSource); + CustomBuildTool.Description = "Generating precompiled header source file '" + toFile + "' ..."; + CustomBuildTool.Outputs += toFile; + + QStringList lines; + CustomBuildTool.CommandLine += + "echo /*-------------------------------------------------------------------- >" + toFile; + lines << "* Precompiled header source file used by Visual Studio.NET to generate"; + lines << "* the .pch file."; + lines << "*"; + lines << "* Due to issues with the dependencies checker within the IDE, it"; + lines << "* sometimes fails to recompile the PCH file, if we force the IDE to"; + lines << "* create the PCH file directly from the header file."; + lines << "*"; + lines << "* This file is auto-generated by qmake since no PRECOMPILED_SOURCE was"; + lines << "* specified, and is used as the common stdafx.cpp. The file is only"; + lines << QLatin1String("* generated when creating ") + + (Config->CompilerVersion < NET2010 ? ".vcproj" : ".vcxproj") + + " project files, and is not used for"; + lines << "* command line compilations by nmake."; + lines << "*"; + lines << "* WARNING: All changes made in this file will be lost."; + lines << "--------------------------------------------------------------------*/"; + lines << "#include \"" + Project->precompHFilename + "\""; + for (const QString &line : qAsConst(lines)) + CustomBuildTool.CommandLine += "echo " + line + ">>" + toFile; + return; + } + + useCompilerTool = true; + const bool isPrecompSource = pchThroughSourceFile && (str == Project->precompSource); + if (isPrecompSource) { + CompilerTool.UsePrecompiledHeader = pchCreateUsingSpecific; + if (Project->autogenPrecompSource) + CompilerTool.PrecompiledHeaderThrough = Project->precompHFilename; + CompilerTool.ForcedIncludeFiles = QStringList("$(NOINHERIT)"); + return; + } + bool isCFile = false; for (QStringList::Iterator it = Option::c_ext.begin(); it != Option::c_ext.end(); ++it) { if (str.endsWith(*it)) { @@ -2222,53 +2264,13 @@ void VCFilter::modifyPCHstage(QString str) break; } } - const bool isHFile = (str == Project->precompH); - bool isCPPFile = pchThroughSourceFile && (str == Project->precompCPP); - - if(!isCFile && !isHFile && !isCPPFile) - return; - - if(isHFile && pchThroughSourceFile) { - if (autogenSourceFile) { - useCustomBuildTool = true; - QString toFile(Project->precompCPP); - CustomBuildTool.Description = "Generating precompiled header source file '" + toFile + "' ..."; - CustomBuildTool.Outputs += toFile; - - QStringList lines; - CustomBuildTool.CommandLine += - "echo /*-------------------------------------------------------------------- >" + toFile; - lines << "* Precompiled header source file used by Visual Studio.NET to generate"; - lines << "* the .pch file."; - lines << "*"; - lines << "* Due to issues with the dependencies checker within the IDE, it"; - lines << "* sometimes fails to recompile the PCH file, if we force the IDE to"; - lines << "* create the PCH file directly from the header file."; - lines << "*"; - lines << "* This file is auto-generated by qmake since no PRECOMPILED_SOURCE was"; - lines << "* specified, and is used as the common stdafx.cpp. The file is only"; - lines << QLatin1String("* generated when creating ") - + (Config->CompilerVersion < NET2010 ? ".vcproj" : ".vcxproj") - + " project files, and is not used for"; - lines << "* command line compilations by nmake."; - lines << "*"; - lines << "* WARNING: All changes made in this file will be lost."; - lines << "--------------------------------------------------------------------*/"; - lines << "#include \"" + Project->precompHFilename + "\""; - for (const QString &line : qAsConst(lines)) - CustomBuildTool.CommandLine += "echo " + line + ">>" + toFile; - } - return; - } - useCompilerTool = true; - // Setup PCH options - CompilerTool.UsePrecompiledHeader = (isCFile ? pchNone : pchCreateUsingSpecific); - if (isCFile) + bool pchCompatible = (isCFile == Project->pchIsCFile); + if (!pchCompatible) { + CompilerTool.UsePrecompiledHeader = pchNone; CompilerTool.PrecompiledHeaderThrough = QLatin1String("$(NOINHERIT)"); - else if (autogenSourceFile) - CompilerTool.PrecompiledHeaderThrough = Project->precompHFilename; - CompilerTool.ForcedIncludeFiles = QStringList("$(NOINHERIT)"); + CompilerTool.ForcedIncludeFiles = QStringList("$(NOINHERIT)"); + } } VCFilterFile VCFilter::findFile(const QString &filePath, bool *found) const diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index 9d1a170489..33a96bf85e 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -52,7 +52,8 @@ enum DotNET { NET2012 = 0xb0, NET2013 = 0xc0, NET2015 = 0xd0, - NET2017 = 0xe0 + NET2017 = 0xe0, + NET2019 }; DotNET vsVersionFromString(const ProString &versionString); @@ -1123,6 +1124,8 @@ public: QString SccLocalPath; QString PlatformName; QString SdkVersion; + QString WindowsTargetPlatformVersion; + QString WindowsTargetPlatformMinVersion; // Single projects QList<VCProjectSingleConfig> SingleProjects; diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index f7837fc1b4..fd53ec2a6e 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -73,7 +73,9 @@ const char _slnHeader120[] = "Microsoft Visual Studio Solution File, Format const char _slnHeader140[] = "Microsoft Visual Studio Solution File, Format Version 12.00" "\n# Visual Studio 2015"; const char _slnHeader141[] = "Microsoft Visual Studio Solution File, Format Version 12.00" - "\n# Visual Studio 2017"; + "\n# Visual Studio 15"; +const char _slnHeader142[] = "Microsoft Visual Studio Solution File, Format Version 12.00" + "\n# Visual Studio Version 16"; // The following UUID _may_ change for later servicepacks... // If so we need to search through the registry at // HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\Projects @@ -191,6 +193,10 @@ bool VcprojGenerator::writeProjectMakefile() mergedProject.SccProjectName = mergedProjects.at(0)->vcProject.SccProjectName; mergedProject.SccLocalPath = mergedProjects.at(0)->vcProject.SccLocalPath; mergedProject.PlatformName = mergedProjects.at(0)->vcProject.PlatformName; + mergedProject.WindowsTargetPlatformVersion = + project->first("WINDOWS_TARGET_PLATFORM_VERSION").toQString(); + mergedProject.WindowsTargetPlatformMinVersion = + project->first("WINDOWS_TARGET_PLATFORM_MIN_VERSION").toQString(); XmlOutput xmlOut(t); projectWriter->write(xmlOut, mergedProject); @@ -208,6 +214,16 @@ struct VcsolutionDepend { QStringList dependencies; }; +/* Disable optimization in getProjectUUID() due to a compiler + * bug in MSVC 2015 that causes ASSERT: "&other != this" in the QString + * copy constructor for non-empty file names at: + * filename.isEmpty()?project->first("QMAKE_MAKEFILE"):filename */ + +#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG) +# pragma optimize( "g", off ) +# pragma warning ( disable : 4748 ) +#endif + QUuid VcprojGenerator::getProjectUUID(const QString &filename) { bool validUUID = true; @@ -239,6 +255,10 @@ QUuid VcprojGenerator::getProjectUUID(const QString &filename) return uuid; } +#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG) +# pragma optimize( "g", on ) +#endif + QUuid VcprojGenerator::increaseUUID(const QUuid &id) { QUuid result(id); @@ -287,6 +307,8 @@ QString VcprojGenerator::retrievePlatformToolSet() const return QStringLiteral("v140"); case NET2017: return QStringLiteral("v141"); + case NET2019: + return QStringLiteral("v142"); default: return QString(); } @@ -459,8 +481,8 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt // Add all unknown libs to the deps QStringList where = QStringList() << "LIBS" << "LIBS_PRIVATE" << "QMAKE_LIBS" << "QMAKE_LIBS_PRIVATE"; - for (QStringList::ConstIterator wit = where.begin(); - wit != where.end(); ++wit) { + for (QStringList::ConstIterator wit = where.cbegin(); + wit != where.cend(); ++wit) { const ProStringList &l = tmp_proj.values(ProKey(*wit)); for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) { const QString opt = fixLibFlag(*it).toQString(); @@ -513,6 +535,9 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) } switch (vcProject.Configuration.CompilerVersion) { + case NET2019: + t << _slnHeader142; + break; case NET2017: t << _slnHeader141; break; @@ -757,8 +782,9 @@ void VcprojGenerator::init() // Setup PCH variables precompH = project->first("PRECOMPILED_HEADER").toQString(); - precompCPP = project->first("PRECOMPILED_SOURCE").toQString(); - usePCH = !precompH.isEmpty() && project->isActiveConfig("precompile_header"); + precompSource = project->first("PRECOMPILED_SOURCE").toQString(); + pchIsCFile = project->isActiveConfig("precompile_header_c"); + usePCH = !precompH.isEmpty() && (pchIsCFile || project->isActiveConfig("precompile_header")); if (usePCH) { precompHFilename = fileInfo(precompH).fileName(); // Created files @@ -772,13 +798,15 @@ void VcprojGenerator::init() project->values("PRECOMPILED_OBJECT") = ProStringList(precompObj); project->values("PRECOMPILED_PCH") = ProStringList(precompPch); - autogenPrecompCPP = precompCPP.isEmpty() && project->isActiveConfig("autogen_precompile_source"); - if (autogenPrecompCPP) { - precompCPP = precompH - + (Option::cpp_ext.count() ? Option::cpp_ext.at(0) : QLatin1String(".cpp")); - project->values("GENERATED_SOURCES") += precompCPP; - } else if (!precompCPP.isEmpty()) { - project->values("SOURCES") += precompCPP; + autogenPrecompSource = precompSource.isEmpty() && project->isActiveConfig("autogen_precompile_source"); + if (autogenPrecompSource) { + precompSource = precompH + + (pchIsCFile + ? (Option::c_ext.count() ? Option::c_ext.at(0) : QLatin1String(".c")) + : (Option::cpp_ext.count() ? Option::cpp_ext.at(0) : QLatin1String(".cpp"))); + project->values("GENERATED_SOURCES") += precompSource; + } else if (!precompSource.isEmpty()) { + project->values("SOURCES") += precompSource; } } @@ -860,6 +888,9 @@ void VcprojGenerator::initProject() // Own elements ----------------------------- vcProject.Name = project->first("QMAKE_ORIG_TARGET").toQString(); switch (vcProject.Configuration.CompilerVersion) { + case NET2019: + vcProject.Version = "16.00"; + break; case NET2017: vcProject.Version = "15.00"; break; @@ -1032,16 +1063,6 @@ void VcprojGenerator::initCompilerTool() conf.compiler.PrecompiledHeaderFile = "$(IntDir)\\" + precompPch; conf.compiler.PrecompiledHeaderThrough = project->first("PRECOMPILED_HEADER").toQString(); conf.compiler.ForcedIncludeFiles = project->values("PRECOMPILED_HEADER").toQStringList(); - - if (conf.CompilerVersion <= NET2003) { - // Minimal build option triggers an Internal Compiler Error - // when used in conjunction with /FI and /Yu, so remove it - // ### work-around for a VS 2003 bug. Move to some prf file or remove completely. - project->values("QMAKE_CFLAGS_DEBUG").removeAll("-Gm"); - project->values("QMAKE_CFLAGS_DEBUG").removeAll("/Gm"); - project->values("QMAKE_CXXFLAGS_DEBUG").removeAll("-Gm"); - project->values("QMAKE_CXXFLAGS_DEBUG").removeAll("/Gm"); - } } conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS")); @@ -1326,7 +1347,7 @@ void VcprojGenerator::initWinDeployQtTool() // structure manually by invoking windeployqt a second time, so that // the MDILXapCompile call succeeds and deployment continues. conf.windeployqt.CommandLine += commandLine - + QStringLiteral(" -list relative -dir \"$(MSBuildProjectDirectory)\" \"$(OutDir)\\$(TargetName).exe\" > ") + + QStringLiteral(" -list relative -dir \"$(MSBuildProjectDirectory)\" \"$(OutDir)\\$(TargetFileName)\" > ") + MakefileGenerator::shellQuote(conf.windeployqt.Record); conf.windeployqt.config = &vcProject.Configuration; conf.windeployqt.ExcludedFromBuild = false; @@ -1423,6 +1444,7 @@ void VcprojGenerator::initTranslationFiles() vcProject.TranslationFiles.Guid = _GUIDTranslationFiles; vcProject.TranslationFiles.addFiles(project->values("TRANSLATIONS")); + vcProject.TranslationFiles.addFiles(project->values("EXTRA_TRANSLATIONS")); vcProject.TranslationFiles.Project = this; vcProject.TranslationFiles.Config = &(vcProject.Configuration); @@ -1527,14 +1549,14 @@ void VcprojGenerator::initExtraCompilerOutputs() extraCompile.Filter = ""; extraCompile.Guid = QString(_GUIDExtraCompilerFiles) + "-" + (*it); - // If the extra compiler has a variable_out set the output file - // is added to an other file list, and does not need its own.. bool addOnInput = hasBuiltinCompiler(firstExpandedOutputFileName(*it)); - const ProString &tmp_other_out = project->first(ProKey(*it + ".variable_out")); - if (!tmp_other_out.isEmpty() && !addOnInput) - continue; - if (!addOnInput) { + // If the extra compiler has a variable_out set that is already handled + // some other place, ignore it. + const ProString &outputVar = project->first(ProKey(*it + ".variable_out")); + if (!outputVar.isEmpty() && otherFilters.contains(outputVar)) + continue; + QString tmp_out = project->first(ProKey(*it + ".output")).toQString(); if (project->values(ProKey(*it + ".CONFIG")).indexOf("combine") != -1) { // Combined output, only one file result @@ -1545,7 +1567,7 @@ void VcprojGenerator::initExtraCompilerOutputs() const ProStringList &tmp_in = project->values(project->first(ProKey(*it + ".input")).toKey()); for (int i = 0; i < tmp_in.count(); ++i) { const QString &filename = tmp_in.at(i).toQString(); - if (extraCompilerSources.contains(filename)) + if (extraCompilerSources.contains(filename) && !otherFiltersContain(filename)) extraCompile.addFile(Option::fixPathToTargetOS( replaceExtraCompilerVariables(filename, tmp_out, QString(), NoShell), false)); } @@ -1561,7 +1583,7 @@ void VcprojGenerator::initExtraCompilerOutputs() const ProStringList &tmp_in = project->values(inputVar.toKey()); for (int i = 0; i < tmp_in.count(); ++i) { const QString &filename = tmp_in.at(i).toQString(); - if (extraCompilerSources.contains(filename)) + if (extraCompilerSources.contains(filename) && !otherFiltersContain(filename)) extraCompile.addFile(Option::fixPathToTargetOS( replaceExtraCompilerVariables(filename, QString(), QString(), NoShell), false)); } @@ -1575,6 +1597,28 @@ void VcprojGenerator::initExtraCompilerOutputs() } } +bool VcprojGenerator::otherFiltersContain(const QString &fileName) const +{ + auto filterFileMatches = [&fileName] (const VCFilterFile &ff) + { + return ff.file == fileName; + }; + for (const VCFilter *filter : { &vcProject.RootFiles, + &vcProject.SourceFiles, + &vcProject.HeaderFiles, + &vcProject.GeneratedFiles, + &vcProject.LexYaccFiles, + &vcProject.TranslationFiles, + &vcProject.FormFiles, + &vcProject.ResourceFiles, + &vcProject.DeploymentFiles, + &vcProject.DistributionFiles}) { + if (std::any_of(filter->Files.cbegin(), filter->Files.cend(), filterFileMatches)) + return true; + } + return false; +} + // ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------ diff --git a/qmake/generators/win32/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h index 6af5ec7007..55d36c3762 100644 --- a/qmake/generators/win32/msvc_vcproj.h +++ b/qmake/generators/win32/msvc_vcproj.h @@ -57,15 +57,16 @@ public: ~VcprojGenerator(); QString defaultMakefile() const; - QString precompH, precompHFilename, precompCPP, + QString precompH, precompHFilename, precompSource, precompObj, precompPch; - bool autogenPrecompCPP; + bool autogenPrecompSource; static bool hasBuiltinCompiler(const QString &file); QHash<QString, QStringList> extraCompilerSources; QHash<QString, QString> extraCompilerOutputs; const QString customBuildToolFilterFileSuffix; bool usePCH; + bool pchIsCFile = false; VCProjectWriter *projectWriter; protected: @@ -131,6 +132,7 @@ private: ProString firstInputFileName(const ProString &extraCompilerName) const; QString firstExpandedOutputFileName(const ProString &extraCompilerName); void createCustomBuildToolFakeFile(const QString &cbtFilePath, const QString &realOutFilePath); + bool otherFiltersContain(const QString &fileName) const; friend class VCFilter; }; diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index e0d03ccc1c..16f9361d13 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -84,6 +84,9 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) if (impexts.isEmpty()) impexts = project->values("QMAKE_EXTENSION_STATICLIB"); QList<QMakeLocalFileName> dirs; + int libidx = 0; + for (const ProString &dlib : project->values("QMAKE_DEFAULT_LIBDIRS")) + dirs.append(QMakeLocalFileName(dlib.toQString())); static const char * const lflags[] = { "LIBS", "LIBS_PRIVATE", "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", nullptr }; for (int i = 0; lflags[i]; i++) { @@ -94,11 +97,12 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) LibFlagType type = parseLibFlag(opt, &arg); if (type == LibFlagPath) { QMakeLocalFileName lp(arg.toQString()); - if (dirs.contains(lp)) { + int idx = dirs.indexOf(lp); + if (idx >= 0 && idx < libidx) { it = l.erase(it); continue; } - dirs.append(lp); + dirs.insert(libidx++, lp); (*it) = "-L" + lp.real(); } else if (type == LibFlagLib) { QString lib = arg.toQString(); @@ -112,8 +116,8 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) goto found; } QString libBase = (*dir_it).local() + '/' + lib + verovr; - for (ProStringList::ConstIterator extit = impexts.begin(); - extit != impexts.end(); ++extit) { + for (ProStringList::ConstIterator extit = impexts.cbegin(); + extit != impexts.cend(); ++extit) { if (exists(libBase + '.' + *extit)) { (*it) = cand + verovr + '.' + *extit; goto found; @@ -520,6 +524,8 @@ void Win32MakefileGenerator::writeIncPart(QTextStream &t) void Win32MakefileGenerator::writeStandardParts(QTextStream &t) { + writeExportedVariables(t); + t << "####### Compiler, tools and options\n\n"; t << "CC = " << var("QMAKE_CC") << endl; t << "CXX = " << var("QMAKE_CXX") << endl; diff --git a/qmake/library/ioutils.cpp b/qmake/library/ioutils.cpp index 2b2c6d0078..3e49a99cd5 100644 --- a/qmake/library/ioutils.cpp +++ b/qmake/library/ioutils.cpp @@ -77,7 +77,12 @@ bool IoUtils::isRelativePath(const QString &path) && (path.at(2) == QLatin1Char('/') || path.at(2) == QLatin1Char('\\'))) { return false; } - // (... unless, of course, they're UNC, which qmake fails on anyway) + // ... unless, of course, they're UNC: + if (path.length() >= 2 + && (path.at(0).unicode() == '\\' || path.at(0).unicode() == '/') + && path.at(1) == path.at(0)) { + return false; + } #else if (path.startsWith(QLatin1Char('/'))) return false; diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h index 2b09fc2074..6882f2802f 100644 --- a/qmake/library/proitems.h +++ b/qmake/library/proitems.h @@ -133,7 +133,7 @@ public: bool contains(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(s, 0, cs) >= 0; } bool contains(const char *s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(QLatin1String(s), 0, cs) >= 0; } bool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(c, 0, cs) >= 0; } - int toLongLong(bool *ok = nullptr, int base = 10) const { return toQStringRef().toLongLong(ok, base); } + qlonglong toLongLong(bool *ok = nullptr, int base = 10) const { return toQStringRef().toLongLong(ok, base); } int toInt(bool *ok = nullptr, int base = 10) const { return toQStringRef().toInt(ok, base); } short toShort(bool *ok = nullptr, int base = 10) const { return toQStringRef().toShort(ok, base); } @@ -429,7 +429,7 @@ class ProFunctionDef { public: ProFunctionDef(ProFile *pro, int offset) : m_pro(pro), m_offset(offset) { m_pro->ref(); } ProFunctionDef(const ProFunctionDef &o) : m_pro(o.m_pro), m_offset(o.m_offset) { m_pro->ref(); } - ProFunctionDef(ProFunctionDef &&other) Q_DECL_NOTHROW + ProFunctionDef(ProFunctionDef &&other) noexcept : m_pro(other.m_pro), m_offset(other.m_offset) { other.m_pro = nullptr; } ~ProFunctionDef() { m_pro->deref(); } ProFunctionDef &operator=(const ProFunctionDef &o) @@ -442,13 +442,13 @@ public: } return *this; } - ProFunctionDef &operator=(ProFunctionDef &&other) Q_DECL_NOTHROW + ProFunctionDef &operator=(ProFunctionDef &&other) noexcept { ProFunctionDef moved(std::move(other)); swap(moved); return *this; } - void swap(ProFunctionDef &other) Q_DECL_NOTHROW + void swap(ProFunctionDef &other) noexcept { qSwap(m_pro, other.m_pro); qSwap(m_offset, other.m_offset); diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index f81bec158b..3c4e509fc6 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -52,6 +52,9 @@ # include <qthreadpool.h> #endif #include <qversionnumber.h> +#ifdef Q_OS_WIN +# include <registry_p.h> +#endif #include <algorithm> @@ -93,7 +96,7 @@ enum ExpandFunc { E_UPPER, E_LOWER, E_TITLE, E_FILES, E_PROMPT, E_RE_ESCAPE, E_VAL_ESCAPE, E_REPLACE, E_SORT_DEPENDS, E_RESOLVE_DEPENDS, E_ENUMERATE_VARS, E_SHADOWED, E_ABSOLUTE_PATH, E_RELATIVE_PATH, E_CLEAN_PATH, - E_SYSTEM_PATH, E_SHELL_PATH, E_SYSTEM_QUOTE, E_SHELL_QUOTE, E_GETENV + E_SYSTEM_PATH, E_SHELL_PATH, E_SYSTEM_QUOTE, E_SHELL_QUOTE, E_GETENV, E_READ_REGISTRY }; enum TestFunc { @@ -190,6 +193,7 @@ void QMakeEvaluator::initFunctionStatics() { "system_quote", E_SYSTEM_QUOTE, -1, 1, "arg" }, { "shell_quote", E_SHELL_QUOTE, -1, 1, "arg" }, { "getenv", E_GETENV, 1, 1, "arg" }, + { "read_registry", E_READ_REGISTRY, 2, 3, "tree, key, [wow64]" }, }; statics.expands.reserve((int)(sizeof(expandInits)/sizeof(expandInits[0]))); for (unsigned i = 0; i < sizeof(expandInits)/sizeof(expandInits[0]); ++i) @@ -878,8 +882,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand( ret += values(map(args.at(0))); break; case E_LIST: { - QString tmp; - tmp.sprintf(".QMAKE_INTERNAL_TMP_variableName_%d", m_listCount++); + QString tmp(QString::asprintf(".QMAKE_INTERNAL_TMP_variableName_%d", m_listCount++)); ret = ProStringList(ProString(tmp)); ProStringList lst; for (const ProString &arg : args) @@ -1214,6 +1217,40 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand( ret << ProString(m_option->getEnv(u1.str())); break; } +#ifdef Q_OS_WIN + case E_READ_REGISTRY: { + HKEY tree; + const auto par = args.at(0); + if (!par.compare(QLatin1String("HKCU"), Qt::CaseInsensitive) + || !par.compare(QLatin1String("HKEY_CURRENT_USER"), Qt::CaseInsensitive)) { + tree = HKEY_CURRENT_USER; + } else if (!par.compare(QLatin1String("HKLM"), Qt::CaseInsensitive) + || !par.compare(QLatin1String("HKEY_LOCAL_MACHINE"), Qt::CaseInsensitive)) { + tree = HKEY_LOCAL_MACHINE; + } else { + evalError(fL1S("read_registry(): invalid or unsupported registry tree %1.") + .arg(par.toQStringView())); + goto allfail; + } + int flags = 0; + if (args.count() > 2) { + const auto opt = args.at(2); + if (opt == "32" + || !opt.compare(QLatin1String("wow64_32key"), Qt::CaseInsensitive)) { + flags = KEY_WOW64_32KEY; + } else if (opt == "64" + || !opt.compare(QLatin1String("wow64_64key"), Qt::CaseInsensitive)) { + flags = KEY_WOW64_64KEY; + } else { + evalError(fL1S("read_registry(): invalid option %1.") + .arg(opt.toQStringView())); + goto allfail; + } + } + ret << ProString(qt_readRegistryKey(tree, args.at(1).toQString(m_tmp1), flags)); + break; + } +#endif default: evalError(fL1S("Function '%1' is not implemented.").arg(func.toQStringView())); break; diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index 432339d48e..ade8e15a39 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -1190,7 +1190,7 @@ bool QMakeEvaluator::loadSpecInternal() # ifdef Q_OS_UNIX if (m_qmakespec.endsWith(QLatin1String("/default-host")) || m_qmakespec.endsWith(QLatin1String("/default"))) { - QString rspec = QFileInfo(m_qmakespec).readLink(); + QString rspec = QFileInfo(m_qmakespec).symLinkTarget(); if (!rspec.isEmpty()) m_qmakespec = QDir::cleanPath(QDir(m_qmakespec).absoluteFilePath(rspec)); } diff --git a/qmake/library/qmakevfs.cpp b/qmake/library/qmakevfs.cpp index 3a54ef4023..1f77595535 100644 --- a/qmake/library/qmakevfs.cpp +++ b/qmake/library/qmakevfs.cpp @@ -35,7 +35,7 @@ using namespace QMakeInternal; #include <qfile.h> #include <qfileinfo.h> -#ifndef QT_NO_TEXTCODEC +#if QT_CONFIG(textcodec) #include <qtextcodec.h> #endif @@ -49,7 +49,7 @@ QMakeVfs::QMakeVfs() , m_magicExisting(fL1S("existing")) #endif { -#ifndef QT_NO_TEXTCODEC +#if QT_CONFIG(textcodec) m_textCodec = 0; #endif ref(); @@ -109,10 +109,10 @@ int QMakeVfs::idForFileName(const QString &fn, VfsFlags flags) return id; } #endif - if (!(flags & VfsAccessedOnly)) { #ifdef PROPARSER_THREAD_SAFE - QMutexLocker locker(&s_mutex); + QMutexLocker locker(&s_mutex); #endif + if (!(flags & VfsAccessedOnly)) { int &id = s_fileIdMap[fn]; if (!id) { id = ++s_fileIdCounter; @@ -236,7 +236,7 @@ QMakeVfs::ReadResult QMakeVfs::readFile(int id, QString *contents, QString *errS return ReadOtherError; } *contents = -#ifndef QT_NO_TEXTCODEC +#if QT_CONFIG(textcodec) m_textCodec ? m_textCodec->toUnicode(bcont) : #endif QString::fromLocal8Bit(bcont); @@ -290,7 +290,7 @@ void QMakeVfs::invalidateContents() } #endif -#ifndef QT_NO_TEXTCODEC +#if QT_CONFIG(textcodec) void QMakeVfs::setTextCodec(const QTextCodec *textCodec) { m_textCodec = textCodec; diff --git a/qmake/library/qmakevfs.h b/qmake/library/qmakevfs.h index 68c21a3d37..fccbcfb765 100644 --- a/qmake/library/qmakevfs.h +++ b/qmake/library/qmakevfs.h @@ -38,7 +38,7 @@ # include <qmutex.h> #endif -#ifndef QT_NO_TEXTCODEC +#if QT_CONFIG(textcodec) QT_FORWARD_DECLARE_CLASS(QTextCodec) #endif @@ -92,7 +92,7 @@ public: void invalidateContents(); #endif -#ifndef QT_NO_TEXTCODEC +#if QT_CONFIG(textcodec) void setTextCodec(const QTextCodec *textCodec); #endif @@ -129,7 +129,7 @@ private: QString m_magicMissing; QString m_magicExisting; #endif -#ifndef QT_NO_TEXTCODEC +#if QT_CONFIG(textcodec) const QTextCodec *m_textCodec; #endif }; diff --git a/qmake/generators/win32/registry.cpp b/qmake/library/registry.cpp index 3391ab9512..3391ab9512 100644 --- a/qmake/generators/win32/registry.cpp +++ b/qmake/library/registry.cpp diff --git a/qmake/generators/win32/registry_p.h b/qmake/library/registry_p.h index 3526dffd45..f9e8bba016 100644 --- a/qmake/generators/win32/registry_p.h +++ b/qmake/library/registry_p.h @@ -40,8 +40,6 @@ // We mean it. // -QT_BEGIN_NAMESPACE - #include <QtCore/qglobal.h> #ifdef Q_OS_WIN32 @@ -52,6 +50,8 @@ QT_BEGIN_NAMESPACE #include <QtCore/qstring.h> +QT_BEGIN_NAMESPACE + /** * Read a value from the Windows registry. * diff --git a/qmake/main.cpp b/qmake/main.cpp index a4ef79227b..a598296898 100644 --- a/qmake/main.cpp +++ b/qmake/main.cpp @@ -242,7 +242,8 @@ static int doLink(int argc, char **argv) #endif -static int installFile(const QString &source, const QString &target, bool exe = false) +static int installFile(const QString &source, const QString &target, bool exe = false, + bool preservePermissions = false) { QFile sourceFile(source); QFile targetFile(target); @@ -260,35 +261,32 @@ static int installFile(const QString &source, const QString &target, bool exe = return 3; } + QFileDevice::Permissions targetPermissions = preservePermissions + ? sourceFile.permissions() + : (QFileDevice::ReadOwner | QFileDevice::WriteOwner + | QFileDevice::ReadUser | QFileDevice::WriteUser + | QFileDevice::ReadGroup | QFileDevice::ReadOther); if (exe) { - if (!targetFile.setPermissions(sourceFile.permissions() | QFileDevice::ExeOwner | QFileDevice::ExeUser | - QFileDevice::ExeGroup | QFileDevice::ExeOther)) { - fprintf(stderr, "Error setting execute permissions on %s: %s\n", - qPrintable(target), qPrintable(targetFile.errorString())); - return 3; - } + targetPermissions |= QFileDevice::ExeOwner | QFileDevice::ExeUser | + QFileDevice::ExeGroup | QFileDevice::ExeOther; + } + if (!targetFile.setPermissions(targetPermissions)) { + fprintf(stderr, "Error setting permissions on %s: %s\n", + qPrintable(target), qPrintable(targetFile.errorString())); + return 3; } // Copy file times QString error; -#ifdef Q_OS_WIN - const QFile::Permissions permissions = targetFile.permissions(); - const bool readOnly = !(permissions & QFile::WriteUser); - if (readOnly) - targetFile.setPermissions(permissions | QFile::WriteUser); -#endif if (!IoUtils::touchFile(target, sourceFile.fileName(), &error)) { fprintf(stderr, "%s", qPrintable(error)); return 3; } -#ifdef Q_OS_WIN - if (readOnly) - targetFile.setPermissions(permissions); -#endif return 0; } -static int installFileOrDirectory(const QString &source, const QString &target) +static int installFileOrDirectory(const QString &source, const QString &target, + bool preservePermissions = false) { QFileInfo fi(source); if (false) { @@ -308,18 +306,18 @@ static int installFileOrDirectory(const QString &source, const QString &target) } else if (fi.isDir()) { QDir::current().mkpath(target); - QDirIterator it(source, QDir::AllEntries | QDir::NoDotAndDotDot); + QDirIterator it(source, QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden); while (it.hasNext()) { it.next(); const QFileInfo &entry = it.fileInfo(); const QString &entryTarget = target + QDir::separator() + entry.fileName(); - const int recursionResult = installFileOrDirectory(entry.filePath(), entryTarget); + const int recursionResult = installFileOrDirectory(entry.filePath(), entryTarget, true); if (recursionResult != 0) return recursionResult; } } else { - const int fileCopyResult = installFile(source, target); + const int fileCopyResult = installFile(source, target, /*exe*/ false, preservePermissions); if (fileCopyResult != 0) return fileCopyResult; } diff --git a/qmake/meta.cpp b/qmake/meta.cpp index 2e8759b8ba..c5c14d9b56 100644 --- a/qmake/meta.cpp +++ b/qmake/meta.cpp @@ -35,13 +35,6 @@ QT_BEGIN_NAMESPACE QHash<QString, ProValueMap> QMakeMetaInfo::cache_vars; -QMakeMetaInfo::QMakeMetaInfo(QMakeProject *_conf) - : conf(_conf) -{ - -} - - bool QMakeMetaInfo::readLib(const QString &meta_file) { diff --git a/qmake/meta.h b/qmake/meta.h index 4721085fd2..5f41a37df0 100644 --- a/qmake/meta.h +++ b/qmake/meta.h @@ -41,11 +41,9 @@ class QMakeProject; class QMakeMetaInfo { - QMakeProject *conf; ProValueMap vars; static QHash<QString, ProValueMap> cache_vars; public: - QMakeMetaInfo(QMakeProject *_conf); // These functions expect the path to be normalized static QString checkLib(const QString &lib); diff --git a/qmake/property.cpp b/qmake/property.cpp index c0a3ec0dab..432ff55664 100644 --- a/qmake/property.cpp +++ b/qmake/property.cpp @@ -178,8 +178,8 @@ QMakeProperty::exec() } return true; } - for(QStringList::ConstIterator it = Option::prop::properties.begin(); - it != Option::prop::properties.end(); it++) { + for (QStringList::ConstIterator it = Option::prop::properties.cbegin(); + it != Option::prop::properties.cend(); it++) { if(Option::prop::properties.count() > 1) fprintf(stdout, "%s:", (*it).toLatin1().constData()); const ProKey pkey(*it); @@ -191,11 +191,11 @@ QMakeProperty::exec() } } } else if(Option::qmake_mode == Option::QMAKE_SET_PROPERTY) { - for(QStringList::ConstIterator it = Option::prop::properties.begin(); - it != Option::prop::properties.end(); it++) { + for (QStringList::ConstIterator it = Option::prop::properties.cbegin(); + it != Option::prop::properties.cend(); it++) { QString var = (*it); it++; - if(it == Option::prop::properties.end()) { + if (it == Option::prop::properties.cend()) { ret = false; break; } @@ -203,8 +203,8 @@ QMakeProperty::exec() setValue(var, (*it)); } } else if(Option::qmake_mode == Option::QMAKE_UNSET_PROPERTY) { - for(QStringList::ConstIterator it = Option::prop::properties.begin(); - it != Option::prop::properties.end(); it++) { + for (QStringList::ConstIterator it = Option::prop::properties.cbegin(); + it != Option::prop::properties.cend(); it++) { QString var = (*it); if(!var.startsWith(".")) remove(var); diff --git a/qmake/qmake.pro b/qmake/qmake.pro index 7c3ce3ef89..6a6116c8db 100644 --- a/qmake/qmake.pro +++ b/qmake/qmake.pro @@ -3,8 +3,8 @@ # and the configures. option(host_build) -CONFIG += console -CONFIG -= qt app_bundle +CONFIG += cmdline +CONFIG -= qt DEFINES += \ PROEVALUATOR_FULL \ @@ -96,7 +96,7 @@ HEADERS += \ bp = $$shadowed(..) INCLUDEPATH += \ $$bp/include $$bp/include/QtCore \ - $$bp/include/QtCore/$$QT_VERSION $$bp/include/QtCore/$$QT_VERSION/QtCore + $$bp/include/QtCore/$$QT_VERSION $$bp/include/QtCore/$$QT_VERSION/QtCore \ $$bp/src/corelib/global VPATH += \ @@ -152,7 +152,6 @@ SOURCES += \ qstringlist.cpp \ qsystemerror.cpp \ qtemporaryfile.cpp \ - qtextcodec.cpp \ qtextstream.cpp \ qutfcodec.cpp \ quuid.cpp \ @@ -183,18 +182,17 @@ HEADERS += \ qglobal.h \ qhash.h \ qiodevice.h \ - qjson.h \ + qjson_p.h \ qjsonarray.h \ qjsondocument.h \ qjsonobject.h \ - qjsonparser.h \ + qjsonparser_p.h \ qjsonvalue.h \ - qjsonwriter.h \ + qjsonwriter_p.h \ qlinkedlist.h \ qlist.h \ qlocale.h \ qlocale_tools_p.h \ - qmalloc.h \ qmap.h \ qmetatype.h \ qnumeric.h \ @@ -204,14 +202,13 @@ HEADERS += \ qstringmatcher.h \ qsystemerror_p.h \ qtemporaryfile.h \ - qtextcodec.h \ qtextstream.h \ - qutfcodec.h \ + qutfcodec_p.h \ quuid.h \ qvector.h \ qversionnumber.h \ qxmlstream.h \ - qxmlutils.h + qxmlutils_p.h unix { SOURCES += \ diff --git a/qmake/qmake_pch.h b/qmake/qmake_pch.h index c0f62b263d..c97c872311 100644 --- a/qmake/qmake_pch.h +++ b/qmake/qmake_pch.h @@ -54,10 +54,10 @@ #include <stdlib.h> #include <qregexp.h> -QT_BEGIN_NAMESPACE //#include <qdir.h> //#include "option.h" +QT_BEGIN_NAMESPACE QT_END_NAMESPACE #endif |