CMake: pro2cmake.py: deduplicate and sort libraries
Change-Id: I924cfac365a0b4ba18c2579820bc37729f1ea8d9 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
This commit is contained in:
parent
feeae8e27f
commit
828f2965e7
@ -910,8 +910,9 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *,
|
|||||||
dependencies += scope.expand('QMAKE_USE_PRIVATE') + scope.expand('QMAKE_USE') \
|
dependencies += scope.expand('QMAKE_USE_PRIVATE') + scope.expand('QMAKE_USE') \
|
||||||
+ scope.expand('LIBS_PRIVATE') + scope.expand('LIBS')
|
+ scope.expand('LIBS_PRIVATE') + scope.expand('LIBS')
|
||||||
if dependencies:
|
if dependencies:
|
||||||
cm_fh.write('{} LIBRARIES\n'.format(ind))
|
dependencies_to_print = []
|
||||||
is_framework = False
|
is_framework = False
|
||||||
|
|
||||||
for d in dependencies:
|
for d in dependencies:
|
||||||
if d == '-framework':
|
if d == '-framework':
|
||||||
is_framework = True
|
is_framework = True
|
||||||
@ -925,9 +926,14 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *,
|
|||||||
d = '# Remove: {}'.format(d[1:])
|
d = '# Remove: {}'.format(d[1:])
|
||||||
else:
|
else:
|
||||||
d = substitute_libs(d)
|
d = substitute_libs(d)
|
||||||
cm_fh.write('{} {}\n'.format(ind, d))
|
dependencies_to_print.append(d)
|
||||||
is_framework = False
|
is_framework = False
|
||||||
|
|
||||||
|
if dependencies_to_print:
|
||||||
|
cm_fh.write('{} LIBRARIES\n'.format(ind))
|
||||||
|
for d in sorted(list(set(dependencies_to_print))):
|
||||||
|
cm_fh.write('{} {}\n'.format(ind, d))
|
||||||
|
|
||||||
compile_options = scope.get('QMAKE_CXXFLAGS')
|
compile_options = scope.get('QMAKE_CXXFLAGS')
|
||||||
if compile_options:
|
if compile_options:
|
||||||
cm_fh.write('{} COMPILE_OPTIONS\n'.format(ind))
|
cm_fh.write('{} COMPILE_OPTIONS\n'.format(ind))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user