Commit Graph

21 Commits

Author SHA1 Message Date
Joerg Bornemann
10a0ac759e Windows XP target support for MSVC >= 2012
To enable windows xp support, we must do two things:
1. linker flag must be /SUBSYSTEM:CONSOLE,5.01 or
   /SUBSYSTEM:WINDOWS,5.01. For x64, the version is 5.02.
2. Do not use Windows Kit 8. Win SDK v7.1A is recommended. Prepend the
   right include paths and lib paths to INCLUDE and LIB before
   building.

The Windows XP target support is enabled by passing "-target xp" to
configure.

Task-number: QTBUG-29939

Change-Id: I84c8439606cc2a9d27d64947702846faa4f1e4a2
Reviewed-by: Lucas Wang <wbsecg1@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-04-03 18:31:45 +02:00
Joerg Bornemann
943fc7d782 encode the MSVC version in our mkspecs
This will enable qmake and its users to make decisions based
on the Visual Studio version without guessing it from the
mkspec's name.

Change-Id: I1bb46161111b109c2b4302bfc8c428b5f63c32d9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-03-20 10:36:34 +01:00
Oswald Buddenhagen
19501b0731 Fix win32 mkspecs
Instead of checking for dynamicgl in QT_CONFIG, which is apparently
not possible, revert them and do it in opengl.prf instead.

Dynamic GL is Windows-only for the time being so this should be sufficient.

Change-Id: If293ea4c9b024df52257086c8b6250602a44724d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-03-06 12:21:14 +01:00
Erik Verbruggen
f59083636b Win32: define _HAS_EXCEPTIONS as 0 when exceptions are off.
When this macro is not defined, a number of inline methods in the MSVC
stl will throw exceptions. This in turn generates a warning when
exceptions are not enabled on the compiler command-line.

Change-Id: I5a57ec544bda0c75f04fdea9412b03107f9ff531
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-03-04 11:40:24 +01:00
Laszlo Agocs
97c187da3c Dynamic GL switch on Windows
The patch introduces a new build configuration on Windows which
can be requested by passing -opengl dynamic to configure.

Platforms other than Windows (including WinRT) are not affected.
The existing Angle and desktop configurations are not affected.
These continue to function as before and Angle remains the default.

In the future, when all modules have added support for the dynamic
path, as described below, the default configuration could be changed
to be the dynamic one. This would allow providing a single set of
binaries in the official builds instead of the current two.

When requesting dynamic GL, Angle is built but QT_OPENGL_ES[_2] are
never defined. Instead, the code path that has traditionally been
desktop GL only becomes the dynamic path that has to do runtime
checks. Qt modules and applications are not linked to opengl32.dll or
libegl/glesv2.dll in this case. Instead, QtGui exports all necessary
egl/egl/gl functions which will, under the hood, forward all requests
to a dynamically loaded EGL/WGL/GL implementation.

Porting guide (better said, changes needed to prepare your code to
work with dynamic GL builds when the fallback to Angle is utilized):

1. In !QT_OPENGL_ES[_2] code branches use QOpenGLFunctions::isES() to
differentiate between desktop and ES where needed. Keep in mind that
it is the desktop GL header (plus qopenglext.h) that is included,
not the GLES one.

QtGui's proxy will handle some differences, for example calling
glClearDepth will route to glClearDepthf when needed. The built-in
eglGetProcAddress is able to retrieve pointers for standard GLES2
functions too so code resolving OpenGL 2 functions will function
in any case.

2. QT_CONFIG will contain "opengl" and "dynamicgl" in dynamic builds,
but never "angle" or "opengles2".

3. The preprocessor define QT_OPENGL_DYNAMIC is also available in
dynamic builds. The usage of this is strongly discouraged and should
not be needed anywhere except for QtGui and the platform plugin.

4. Code in need of the library handle can use
QOpenGLFunctions::platformGLHandle().

The decision on which library to load is currently based on a simple
test that creates a dummy window/context and tries to resolve an
OpenGL 2 function. If this fails, it goes for Angle. This seems to work
well on Win7 PCs for example that do not have proper graphics drivers
providing OpenGL installed but are D3D9 capable using the default drivers.

Setting QT_OPENGL to desktop or angle skips the test and forces
usage of the given GL. There are also two new application attributes
that could be used for the same purpose.

If Angle is requested but the libraries are not present, desktop is
tried. If desktop is requested, or if angle is requested but nothing
works, the EGL/WGL functions will still be callable but will return 0.
This conveniently means that eglInitialize() and such will report a failure.

Debug messages can be enabled by setting QT_OPENGLPROXY_DEBUG. This will
tell which implementation is chosen.

The textures example application is ported to OpenGL 2, the GL 1
code path is removed.

[ChangeLog][QtGui] Qt builds on Windows can now be configured for
dynamic loading of the OpenGL implementation. This can be requested
by passing -opengl dynamic to configure. In this mode no modules will
link to opengl32.dll or Angle's libegl/libglesv2. Instead, QtGui will
dynamically choose between desktop and Angle during the first GL/EGL/WGL
call. This allows deploying applications with a single set of Qt libraries
with the ability of transparently falling back to Angle in case the
opengl32.dll is not suitable, due to missing graphics drivers for example.

Task-number: QTBUG-36483
Change-Id: I716fdebbf60b355b7d9ef57d1e069eef366b4ab9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-02-14 10:51:44 +01:00
Oswald Buddenhagen
c31ab2139a disable incremental linking for release_with_debug_info builds
it's very unlikely that these artifacts will need rebuilding during a
debugging session (these pdbs are meant to support crash dump analysis).

Change-Id: Ia8138f9298355b402d8dd3f042f85b669693de64
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-12-03 09:14:41 +01:00
Joerg Bornemann
b378d8ca10 set QMAKE_PLATFORM in win32-msvc2012
Change-Id: I3f43ece757b6f483fde256dbcc00f72b4e71c33e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-05-07 15:03:03 +02:00
Joerg Bornemann
ca354843c8 qmake/vcxproj: add WIN64 macro for x86_46 builds
The compiler defines _WIN32 for x86 builds.
The compiler defines _WIN32 and _WIN64 for x86_64 builds.

For consistency, the same should happen to the user defined macros
without underscore. The WIN32 macro is added in the win32-* mkspecs.

Task-number: QTBUG-30223

Change-Id: I342afed731f4ba253a2708b98f575039a04613d7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-05-07 15:02:59 +02:00
Joerg Bornemann
267dc53ea7 fix _WIN32 compiler defines for MSVC
The compiler defines _WIN32, not WIN32.

Change-Id: I359a188b4ef145b7b78c35c5b72a804200b76507
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-05-07 15:02:55 +02:00
Axel Waggershauser
5fcf441392 Fix '=' alignment and replace tabs in *.conf (whitespace only change)
Replace all tabs with proper space characters and consistently align
the '=' characters. The default alignment for the '=' of 25 characters
has been left as is to get a minimal diff. Lines with the '=' further
to the right and those belonging to 'proper code (TM)' have not been
touched.

The work was mostly done using the following python script (might
come in handy again...):

import sys, re
indent_eq = 25 + 0*4 # 25 characters was the most widely used indentation for the '=' character
p = re.compile(r'(\w+)[ \t]*([\-\+]?)(=$|= )[ \t]*(.*$)')

for fn in sys.argv[1:]:
    with open(fn, 'r+') as f:
        lines = []
        nl_count = 0
        continuity_indent = None
        for l in f:
            m = p.match(l)
            nl = l
            if m:
                n_spaces = max(m.start(3), indent_eq - 1) - len(m.group(2)) - len(m.group(1))
                if m.group(2) and m.start(2) >= indent_eq-1 and m.start(2) % 4 == 0:
                    n_spaces -= 1 # left-shift '+=' by one if the '+' is aligned to a multiple of 4
                n_spaces = max(1, n_spaces) # we want at least one space before '='/'+='
                nl = m.group(1) + ' '*n_spaces + ''.join(m.group(2,3,4)) + '\n'
                continuity_indent = nl.find('= ') + 2 if l[-2] == '\\' else None # remember indent on '\\$'
            elif continuity_indent:
                nl = ' '*continuity_indent + l.lstrip()
                if l[-2] != '\\': # check when to stop the continuation
                    continuity_indent = None
            elif l.startswith('#'):
                nl = l.expandtabs(2)
            if l != nl:
                nl_count += 1
            lines.append(nl)
        if nl_count > 0:
            print fn, nl_count, len(lines)
            f.seek(0)
            f.writelines(lines)
            f.truncate()

Change-Id: I1d2870d0a2fe2e30d398c140fe523e69dd20c81b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-03-27 17:16:37 +01:00
Sergio Ahumada
48e0c4df23 Update copyright year in Digia's license headers
Change-Id: Ic804938fc352291d011800d21e549c10acac66fb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-18 09:07:35 +01:00
Oswald Buddenhagen
94649b4cbd remove definitions of QMAKE_{LIB,INC}DIR_QT
they are gone from all other specs

Change-Id: I93f5800971733af9d9dbc66c7a900d1e2e967473
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-01-11 21:32:11 +01:00
Friedemann Kleint
95a05904b9 ANGLE: Fix debug-and-release builds
Add a 'd' to debug builds to allow both release and debug builds
to be used.

- Add .def-files for Debug
- Build all libraries debug/release
- Add description to README.qt
- Differentiate debug/release in qmake.conf.

Task-number: QTBUG-28196

Change-Id: Ib3081004a6ed2ad71d353244154684d2e0ebbc86
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2012-12-01 08:30:38 +01:00
Konstantin Ritt
ac9b853242 Don't link QtGui to winspool.dll
The printer support API has moved to printsupport module/plugins

Change-Id: I6fdc6c08e600d0f7cc8d79bef808227b54880904
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-11-13 18:51:15 +01:00
Jason Barron
32b72283d0 Define QMAKE_EXTENSION_STATICLIB for MSVC mkspecs.
Change-Id: Ia652001f9be67b0c509495c054875ca1ef8fc049
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-10-03 09:08:27 +02:00
Iikka Eklund
be15856f61 Change copyrights from Nokia to Digia
Change copyrights and license headers from Nokia to Digia

Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-22 19:20:11 +02:00
Oswald Buddenhagen
fff5a8f9c9 make qmakespecs announce the compiler family
on the way to eliminate scoping based on the spec.

gcc and msvc go as such into CONFIG, the other ones get the vendor
prefixed, as most are mostly unknown and thus likely to clash with
users' flags.

Change-Id: Ie622f53d90e96dbf05ce7d8c638cd355f04fa20c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-09-21 02:44:22 +02:00
Oswald Buddenhagen
6a3a234742 centralize initialization of CONFIG in mkspecs
"CONFIG += qt warn_on release link_prl" is in every single spec (though
for link_prl there is one genuine exception and two apparent omissions).

Change-Id: I72e1e315586af828eefa3b0b70998ab892ec3c1a
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-09-08 13:36:20 +02:00
Oswald Buddenhagen
809bc47fad centralize initialization of QT in specs
there is no reason whatsoever to duplicate this so many times, and even
less reason to have specs with a deviating default.

Change-Id: Ia25836c079580adebc373697b8bd03598f79c69b
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-09-08 13:36:16 +02:00
Oswald Buddenhagen
cd9599792e remove useless TEMPLATE assignments from specs
"app" is the built-in default anyway

Change-Id: I4f581ee5b81aee08860dbdda5d863943bceafb1b
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-09-08 13:36:12 +02:00
Andreas Holzammer
495017e5d4 Rename msvc11 to msvc2012
Microsoft has named their new Visual Studio again
after the old naming schema.

Change-Id: Ib1b971807fa89d90b10892a2d78570058e564f3a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
2012-08-07 23:27:17 +02:00