[vlc-devel] [PATCH 1/9] contrib: qt: pass compiler flags directly to the mkspec file

Steve Lhomme robux4 at ycbcr.xyz
Mon Aug 31 09:39:45 CEST 2020


On 2020-08-31 9:38, Pierre Lamot wrote:
> On 2020-08-31 07:07, Steve Lhomme wrote:
>> On 2020-08-28 16:25, Pierre Lamot wrote:
>>>    the -I flags passed to Qt configure script is applied to both 
>>> target and host
>>>    compilation.
>>>    This may cause issues to compile host tools as the headers of the 
>>> target may
>>>    be incompatible with the host (ie: pthread header)
>>> ---
>>>   ...user-defined-compilation-flags-to-qt.patch | 53 +++++++++++++++++++
>>>   contrib/src/qt/rules.mak                      |  6 ++-
>>>   2 files changed, 58 insertions(+), 1 deletion(-)
>>>   create mode 100644 
>>> contrib/src/qt/0001-allow-to-pass-user-defined-compilation-flags-to-qt.patch 
>>>
>>>
>>> diff --git 
>>> a/contrib/src/qt/0001-allow-to-pass-user-defined-compilation-flags-to-qt.patch 
>>> b/contrib/src/qt/0001-allow-to-pass-user-defined-compilation-flags-to-qt.patch 
>>>
>>> new file mode 100644
>>> index 0000000000..71e707daae
>>> --- /dev/null
>>> +++ 
>>> b/contrib/src/qt/0001-allow-to-pass-user-defined-compilation-flags-to-qt.patch 
>>>
>>> @@ -0,0 +1,53 @@
>>> +From 691cced4d252d3b76dce02963c18ca85d125bf09 Mon Sep 17 00:00:00 2001
>>> +From: Pierre Lamot <pierre at videolabs.io>
>>> +Date: Tue, 18 Aug 2020 16:06:06 +0200
>>> +Subject: [PATCH] allow to pass user defined compilation flags to qt
>>> +
>>> +---
>>> + mkspecs/darwin-g++/qmake.conf      | 4 ++++
>>> + mkspecs/win32-clang-g++/qmake.conf | 4 ++++
>>> + mkspecs/win32-g++/qmake.conf       | 4 ++++
>>> + 3 files changed, 12 insertions(+)
>>> +
>>> +diff --git a/mkspecs/darwin-g++/qmake.conf 
>>> b/mkspecs/darwin-g++/qmake.conf
>>> +index 85955f7..8602b78 100644
>>> +--- a/mkspecs/darwin-g++/qmake.conf
>>> ++++ b/mkspecs/darwin-g++/qmake.conf
>>> +@@ -86,4 +86,8 @@ QMAKE_PCH_OUTPUT_EXT    = .gch
>>> + QMAKE_CXXFLAGS_PRECOMPILE += -x objective-c++-header -c 
>>> ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
>>> + QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
>>> +
>>> ++QMAKE_CFLAGS           += $${VLC_EXTRA_CFLAGS}
>>> ++QMAKE_CXXFLAGS         += $${VLC_EXTRA_CXXFLAGS}
>>> ++QMAKE_LDFLAGS          += $${VLC_EXTRA_LDFLAGS}
>>
>> This is very VLC specific. A solution that could be upstreamed would 
>> be better.
>> Also I've had problems with pthread in 3.0 because it uses the old
>> pthread-GC2. With the one from mingw there's no problem. Is there any
>> problem with the includes ?
> 
> Yes, the issue arise when compiling host tools (see the commit 
> description). this affects tools compiled outside of qtbase. ie: 
> qmlcachegen in 5.12 and qmltyperegistrar (which is mandatory) in 5.15
> 
>> There should be a way to set flags for host flags. Qt should not use
>> the env CFLAGS when cross compiling.
> 
> I reported the issue to Qt people. I've been told :
> 
>> Using global -I will affect both host and target tools/libraries. This 
>> isn't something that we can easily fix anymore in Qt 5.
> 
> and
> 
>> The -I arguments are apparently used for both, the target and the host.
>> Put the include paths in your mkspec and the problem should be gone.
> 
> the canonical solution would have been to provide a customised mkspec (I 
> do this for some embed plateforms) but I assumed there was little 
> interest to "copy verbatim their windows mkspec and add our includes" VS 
> "directly patch the one they provide".

Uh, OK if that's what they recommend :/


More information about the vlc-devel mailing list