From f69b681af4f8f51d3424ab857b5f1273432a8b06 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Fri, 15 Apr 2011 02:21:08 +0200 Subject: [PATCH] Added production configuration It is enabled by adding CONFIG+=production in qmake command line Use OMIM_PRODUCTION define in the code --- common.pri | 13 ++++- defines.hpp | 8 ++- iphone/Maps/Maps.xcodeproj/project.pbxproj | 64 +++++++++++++++++++++- version/version.pro | 4 +- 4 files changed, 80 insertions(+), 9 deletions(-) diff --git a/common.pri b/common.pri index f89e1eb347..1108d539c3 100644 --- a/common.pri +++ b/common.pri @@ -20,6 +20,16 @@ CONFIG(release, debug|release) { CONFIG_NAME = debug } +CONFIG(production) { + DEFINES += OMIM_PRODUCTION +} else { + # enable debugging information for non-production release builds + unix|win32-g++ { + QMAKE_CFLAGS_RELEASE += -g + QMAKE_CXXFLAGS_RELEASE += -g + } +} + BINARIES_PATH = $$ROOT_DIR/out/$$CONFIG_NAME TEMP_PATH = $$ROOT_DIR/out/$$CONFIG_NAME/tmp/$$TARGET @@ -73,10 +83,9 @@ win32-msvc2008 { unix|win32-g++ { QMAKE_CXXFLAGS_WARN_ON += -Wno-sign-compare -Wno-strict-aliasing -# QMAKE_CXXFLAGS_RELEASE += -g # experimental QMAKE_CFLAGS_RELEASE -= -O2 - QMAKE_CFLAGS_RELEASE += -O3 + QMAKE_CFLAGS_RELEASE += -O3 QMAKE_CXXFLAGS_RELEASE -= -O2 QMAKE_CXXFLAGS_RELEASE += -O3 QMAKE_CFLAGS_RELEASE *= -ffast-math diff --git a/defines.hpp b/defines.hpp index 38149a7319..062359e1e9 100644 --- a/defines.hpp +++ b/defines.hpp @@ -10,11 +10,15 @@ #define COUNTRIES_FILE "countries.txt" #define DATA_UPDATE_FILE "maps.update" #define BINARY_UPDATE_FILE "binary.update" -#define UPDATE_BASE_URL "http://data.mapswithme.com/" + +#ifdef OMIM_PRODUCTION + #define UPDATE_BASE_URL "http://data.mapswithme.com/" +#else + #define UPDATE_BASE_URL "http://melnichek.ath.cx:34568/maps/" +#endif #define WORLD_FILE_NAME "World" #define SETTINGS_FILE_NAME "settings.ini" - #define DEFAULT_AUTO_UPDATES_ENABLED true diff --git a/iphone/Maps/Maps.xcodeproj/project.pbxproj b/iphone/Maps/Maps.xcodeproj/project.pbxproj index 7c28d123cb..eb5a9d8812 100644 --- a/iphone/Maps/Maps.xcodeproj/project.pbxproj +++ b/iphone/Maps/Maps.xcodeproj/project.pbxproj @@ -725,6 +725,62 @@ }; name = "Simulator Debug"; }; + FA0686DE13578E1D004CFF81 /* Production Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CODE_SIGN_IDENTITY = "iPhone Distribution: Yury Melnichek"; + COMPRESS_PNG_FILES = NO; + COPY_PHASE_STRIP = YES; + CURRENT_PROJECT_VERSION = 1.1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_DYNAMIC_NO_PIC = YES; + GCC_ENABLE_PASCAL_STRINGS = NO; + GCC_FAST_MATH = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_OPTIMIZATION_LEVEL = 3; + GCC_PREPROCESSOR_DEFINITIONS = ( + OMIM_PRODUCTION, + RELEASE, + _RELEASE, + TARGET_OS_IPHONE, + ); + GCC_THUMB_SUPPORT = NO; + GCC_UNROLL_LOOPS = YES; + GCC_VERSION = 4.2; + HEADER_SEARCH_PATHS = ( + ../../3party/protobuf, + ../../3party/protobuf/src, + ../../3party/boost, + ); + INFOPLIST_FILE = "MapsWithMe-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 4.0; + LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/../../../omim-iphone-build/out/release\""; + ONLY_ACTIVE_ARCH = NO; + OTHER_CFLAGS = "-Wall"; + OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; + PRODUCT_NAME = MapsWithMe; + PROVISIONING_PROFILE = "9957359C-0502-4ED2-828B-19C696089716"; + SDKROOT = iphoneos; + STRIP_INSTALLED_PRODUCT = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = "armv6 armv7"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = "Production Release"; + }; + FA0686DF13578E1D004CFF81 /* Production Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../../omim-iphonesim-build/out/debug\"", + ); + }; + name = "Production Release"; + }; FA1DE83111E2205400C6D69A /* Simulator Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -732,14 +788,14 @@ ARCHS = i386; CODE_SIGN_IDENTITY = "Don't Code Sign"; COMPRESS_PNG_FILES = NO; - COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 1.0; + COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_C_LANGUAGE_STANDARD = c99; GCC_DYNAMIC_NO_PIC = YES; GCC_ENABLE_PASCAL_STRINGS = NO; GCC_FAST_MATH = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 3; GCC_PREPROCESSOR_DEFINITIONS = ( TARGET_OS_IPHONE, @@ -845,7 +901,7 @@ GCC_DYNAMIC_NO_PIC = YES; GCC_ENABLE_PASCAL_STRINGS = NO; GCC_FAST_MATH = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 3; GCC_PREPROCESSOR_DEFINITIONS = ( RELEASE, @@ -896,6 +952,7 @@ FA1DE85A11E2235D00C6D69A /* Device Debug */, FA1DE83211E2205400C6D69A /* Simulator Release */, FA1DE85C11E2236200C6D69A /* Device Release */, + FA0686DF13578E1D004CFF81 /* Production Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = "Device Release"; @@ -907,6 +964,7 @@ FA1DE85911E2235D00C6D69A /* Device Debug */, FA1DE83111E2205400C6D69A /* Simulator Release */, FA1DE85B11E2236200C6D69A /* Device Release */, + FA0686DE13578E1D004CFF81 /* Production Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = "Device Release"; diff --git a/version/version.pro b/version/version.pro index fba7be5c69..74ad7a9654 100644 --- a/version/version.pro +++ b/version/version.pro @@ -21,8 +21,8 @@ win32 { versiontarget.depends = FORCE PRE_TARGETDEPS += $$VERSION_HEADER -# regenerate version only in release builds -CONFIG(release, debug|release) { +# regenerate version only in production builds +CONFIG(production) { QMAKE_EXTRA_TARGETS += versiontarget }