From 3005776ca125e882d0c7d10a4ed73cb5235ab898 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Fri, 6 Nov 2015 22:31:34 -0800 Subject: [PATCH 1/4] [qmake] Removed CONFIG+=ordered for easier dependencies and faster builds with make -j --- omim.pro | 158 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 111 insertions(+), 47 deletions(-) diff --git a/omim.pro b/omim.pro index 35db5408ac..fb1459d282 100644 --- a/omim.pro +++ b/omim.pro @@ -14,7 +14,6 @@ lessThan(QT_MAJOR_VERSION, 5) { cache() TEMPLATE = subdirs -CONFIG += ordered HEADERS += defines.hpp @@ -26,75 +25,140 @@ win32:CONFIG(drape) { CONFIG *= desktop } -SUBDIRS = 3party base geometry coding -SUBDIRS += indexer -SUBDIRS += routing +SUBDIRS = 3party base coding geometry indexer routing !CONFIG(osrm) { - SUBDIRS += platform - SUBDIRS += stats - SUBDIRS += storage + SUBDIRS *= platform stats storage - # Integration tests dependencies for gtool + # Integration tests dependencies for gtool. + # TODO(AlexZ): Avoid duplication for routing_integration_tests. CONFIG(gtool):!CONFIG(no-tests) { - SUBDIRS += search - SUBDIRS += map - SUBDIRS += routing/routing_integration_tests + SUBDIRS *= search map + + routing_integration_tests.subdir = routing/routing_integration_tests + routing_integration_tests.depends = $$SUBDIRS + SUBDIRS *= routing_integration_tests } CONFIG(desktop) { - SUBDIRS += generator generator/generator_tool + SUBDIRS *= generator + + generator_tool.subdir = generator/generator_tool + generator_tool.depends = $$SUBDIRS + SUBDIRS *= generator_tool } } !CONFIG(gtool):!CONFIG(osrm) { - SUBDIRS *= anim - SUBDIRS *= graphics - SUBDIRS *= gui - SUBDIRS *= render - SUBDIRS *= search - SUBDIRS *= map - - CONFIG(desktop) { - SUBDIRS += qt - } + SUBDIRS *= anim graphics gui render search map CONFIG(map_designer):CONFIG(desktop) { - SUBDIRS += skin_generator + SUBDIRS *= skin_generator } CONFIG(drape) { - SUBDIRS += drape drape_frontend - + SUBDIRS *= drape drape_frontend CONFIG(desktop) { - SUBDIRS += drape_head + drape_head.depends = $$SUBDIRS + SUBDIRS *= drape_head } } + CONFIG(desktop) { + benchmark_tool.subdir = map/benchmark_tool + benchmark_tool.depends = 3party base coding geometry platform indexer map + SUBDIRS *= benchmark_tool + + qt.depends = $$SUBDIRS + SUBDIRS *= qt + } + CONFIG(desktop):!CONFIG(no-tests) { - SUBDIRS += base/base_tests - SUBDIRS += coding/coding_tests - SUBDIRS += platform/platform_tests_support - SUBDIRS += geometry/geometry_tests - SUBDIRS += platform/platform_tests - SUBDIRS += platform/downloader_tests - SUBDIRS += qt_tstfrm - SUBDIRS += render/render_tests - SUBDIRS += storage/storage_tests - SUBDIRS += search/search_tests - SUBDIRS += map/map_tests map/benchmark_tool map/mwm_tests map/style_tests - SUBDIRS += routing/routing_integration_tests - SUBDIRS += routing/routing_tests - SUBDIRS += generator/generator_tests - SUBDIRS += indexer/indexer_tests - SUBDIRS += graphics/graphics_tests - SUBDIRS += gui/gui_tests - SUBDIRS += pedestrian_routing_tests - SUBDIRS += search/search_integration_tests + # Additional desktop-only, tests-only libraries. + platform_tests_support.subdir = platform/platform_tests_support + SUBDIRS *= platform_tests_support + + # Tests binaries. + base_tests.subdir = base/base_tests + base_tests.depends = base + SUBDIRS *= base_tests + + coding_tests.subdir = coding/coding_tests + coding_tests.depends = 3party base + SUBDIRS *= coding_tests + + geometry_tests.subdir = geometry/geometry_tests + geometry_tests.depends = 3party base geometry indexer + SUBDIRS *= geometry_tests + + indexer_tests.subdir = indexer/indexer_tests + indexer_tests.depends = 3party base coding geometry indexer + SUBDIRS *= indexer_tests + + platform_tests.subdir = platform/platform_tests + platform_tests.depends = 3party base coding platform platform_tests_support + SUBDIRS *= platform_tests + + downloader_tests.subdir = platform/downloader_tests + downloader_tests.depends = 3party base coding platform platform_tests_support + SUBDIRS *= downloader_tests + + storage_tests.subdir = storage/storage_tests + storage_tests.depends = 3party base coding geometry platform storage indexer stats + SUBDIRS *= storage_tests + + search_tests.subdir = search/search_tests + search_tests.depends = 3party base coding geometry platform indexer search + SUBDIRS *= search_tests + + search_integration_tests.subdir = search/search_integration_tests + search_integration_tests.depends = 3party base coding geometry platform indexer search + SUBDIRS *= search_integration_tests + + MapDepLibs = 3party base coding geometry platform storage indexer search map + map_tests.subdir = map/map_tests + map_tests.depends = $$MapDepLibs + SUBDIRS *= map_tests + + mwm_tests.subdir = map/mwm_tests + mwm_tests.depends = $$MapDepLibs + SUBDIRS *= mwm_tests + + style_tests.subdir = map/style_tests + style_tests.depends = $$MapDepLibs + SUBDIRS *= style_tests + + routing_tests.subdir = routing/routing_tests + routing_tests.depends = $$MapDepLibs routing + SUBDIRS *= routing_tests + + routing_integration_tests.subdir = routing/routing_integration_tests + routing_integration_tests.depends = $$MapDepLibs routing + SUBDIRS *= routing_integration_tests + + # TODO(AlexZ): Move pedestrian tests into routing dir. + pedestrian_routing_tests.depends = $$MapDepLibs routing + SUBDIRS *= pedestrian_routing_tests + + generator_tests.subdir = generator/generator_tests + generator_tests.depends = $$MapDepLibs routing generator + SUBDIRS *= generator_tests + + # TODO(AlexZ): Do we really need them? + #SUBDIRS += render/render_tests + #SUBDIRS += graphics/graphics_tests + #SUBDIRS += gui/gui_tests CONFIG(drape) { - SUBDIRS += drape/drape_tests - SUBDIRS += drape_frontend/drape_frontend_tests + SUBDIRS *= qt_tstfrm + + drape_tests.subdir = drape/drape_tests + drape_tests.depends = 3party base coding platform qt_tstfrm + SUBDIRS *= drape_tests + + drape_frontend_tests.subdir = drape_frontend/drape_frontend_tests + drape_frontend_tests.depends = 3party base coding platform drape drape_frontend + SUBDIRS *= drape_frontend_tests } } # !no-tests } # !gtool From 24d0703ef5b9e4c8832a2771af1c04ab75c22adf Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Sat, 7 Nov 2015 00:45:25 -0800 Subject: [PATCH 2/4] Added some TODOs. --- geometry/geometry_tests/geometry_tests.pro | 2 ++ map/benchmark_tool/benchmark_tool.pro | 1 + omim.pro | 6 +++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/geometry/geometry_tests/geometry_tests.pro b/geometry/geometry_tests/geometry_tests.pro index 2100e9625d..8ad7164d13 100644 --- a/geometry/geometry_tests/geometry_tests.pro +++ b/geometry/geometry_tests/geometry_tests.pro @@ -6,6 +6,8 @@ CONFIG -= app_bundle TEMPLATE = app ROOT_DIR = ../.. +# TODO(AlexZ): latlon.hpp introduces indexer dependency for tests, +# because of indexer/mercator.hpp. Either move latlon to indexer, or mercator to geometry. DEPENDENCIES = indexer geometry base include($$ROOT_DIR/common.pri) diff --git a/map/benchmark_tool/benchmark_tool.pro b/map/benchmark_tool/benchmark_tool.pro index bffff69cda..e5d593e024 100644 --- a/map/benchmark_tool/benchmark_tool.pro +++ b/map/benchmark_tool/benchmark_tool.pro @@ -6,6 +6,7 @@ CONFIG -= app_bundle TEMPLATE = app ROOT_DIR = ../.. + DEPENDENCIES = map indexer platform geometry coding base gflags protobuf tomcrypt include($$ROOT_DIR/common.pri) diff --git a/omim.pro b/omim.pro index fb1459d282..7796da1954 100644 --- a/omim.pro +++ b/omim.pro @@ -5,7 +5,10 @@ # map_designer: enable designer-related flags # no-tests: do not build tests for desktop # drape: include drape libraries -# iphone / tizen / android: build an app (implies no-tests) +# +# There are no supported options in CONFIG for mobile platforms. +# Please use XCode or gradle/Android Studio. + lessThan(QT_MAJOR_VERSION, 5) { error("You need Qt 5 to build this project. You have Qt $$QT_VERSION") @@ -17,6 +20,7 @@ TEMPLATE = subdirs HEADERS += defines.hpp +# TODO(AlexZ): Why is it here? Drape should build on win32 too. win32:CONFIG(drape) { CONFIG -= drape } From aecfbcfa3cdbc9ec804879d68f2ced4fc438fc70 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Sat, 7 Nov 2015 00:46:04 -0800 Subject: [PATCH 3/4] Fixed drape project file errors. --- drape/drape_common.pri | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drape/drape_common.pri b/drape/drape_common.pri index 88aaf54fcb..b349f2fdbe 100644 --- a/drape/drape_common.pri +++ b/drape/drape_common.pri @@ -5,7 +5,7 @@ INCLUDEPATH *= $$ROOT_DIR/3party/freetype/include INCLUDEPATH *= $$ROOT_DIR/3party/expat/lib SOURCES += \ - $$ROOT_DIR/3party/stb_image/sdf_image.cpp \ + $$ROOT_DIR/3party/sdf_image/sdf_image.cpp \ $$ROOT_DIR/3party/stb_image/stb_image.c \ $$DRAPE_DIR/data_buffer.cpp \ $$DRAPE_DIR/binding_info.cpp \ @@ -44,8 +44,8 @@ SOURCES += \ $$DRAPE_DIR/utils/vertex_decl.cpp HEADERS += \ - $$ROOT_DIR/sdf_image/sdf_image.h \ - $$ROOT_DIR/stb_image/stb_image.h \ + $$ROOT_DIR/3party/sdf_image/sdf_image.h \ + $$ROOT_DIR/3party/stb_image/stb_image.h \ $$DRAPE_DIR/data_buffer.hpp \ $$DRAPE_DIR/binding_info.hpp \ $$DRAPE_DIR/batcher.hpp \ From 93492c8f1a5c227795e207258d11c023a7c97271 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Sat, 7 Nov 2015 00:46:34 -0800 Subject: [PATCH 4/4] Commented out annoying qtcreator warning. --- drape/drape_common.pri | 2 +- tools/autobuild/shader_preprocessor.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drape/drape_common.pri b/drape/drape_common.pri index b349f2fdbe..54dc8b3e9c 100644 --- a/drape/drape_common.pri +++ b/drape/drape_common.pri @@ -1,5 +1,5 @@ CMDRES = $$system(python ../tools/autobuild/shader_preprocessor.py $$SHADER_COMPILE_ARGS) -message($$CMDRES) +!isEmpty($$CMDRES):message($$CMDRES) INCLUDEPATH *= $$ROOT_DIR/3party/freetype/include INCLUDEPATH *= $$ROOT_DIR/3party/expat/lib diff --git a/tools/autobuild/shader_preprocessor.py b/tools/autobuild/shader_preprocessor.py index 2f9f7a62aa..729e980bba 100644 --- a/tools/autobuild/shader_preprocessor.py +++ b/tools/autobuild/shader_preprocessor.py @@ -214,8 +214,9 @@ def validateDocumentation(shaders, shaderDir): for shader in shaders: if formatShaderDocName(shader) not in docFiles: undocumentedShaders.append(shader) - if undocumentedShaders: - print("no documentation for shaders:", undocumentedShaders) + # TODO(AlexZ): Commented out lines below to avoid qtcreator console spamming. + #if undocumentedShaders: + #print("no documentation for shaders:", undocumentedShaders) #exit(20) if len(sys.argv) < 4: @@ -238,7 +239,8 @@ if definitionChanged(headerFile, formatOutFilePath(shaderDir, definesFile)): f = open(formatOutFilePath(shaderDir, definesFile), 'w') f.write(headerFile) f.close() -else: - print("No need to update definition file") +# TODO(AlexZ): Commented out lines below to avoid qtcreator console spamming. +#else: + #print("No need to update definition file") writeImplementationFile(programDefinition, programIndex, shaderIndex, shaderDir, implFile, definesFile, shaders) validateDocumentation(shaders, shaderDir)