[Interest] How make qmake set build settings for iOS to avoid manual Xcode "Update to recommended settings” ?

Edward Sutton edward.sutton at subsite.com
Thu Apr 30 20:22:59 CEST 2015


Solved, mostly….

Everything except an issue “Automatically Select Architecture” which I though ONLY_ACTIVE_ARCH would fix.

Maybe I do not want this fixed for Jenkins CI builds.


# Use QMAKE_MAC_XCODE_SETTINGS to set Xcode build settings in the quake project file:

ios {





    # Set "Target"

    QMAKE_IOS_DEPLOYMENT_TARGET = 6.0


    # Set "Devices" (2=iPad Only)

    # Note for devices: 1=iPhone, 2=iPad, 1,2=Universal.

    #

    # warning: User supplied UIDeviceFamily key in the Info.plist will be overwritten.

    # Please use the build setting TARGETED_DEVICE_FAMILY and remove UIDeviceFamily from your Info.plist.

    #QMAKE_IOS_TARGETED_DEVICE_FAMILY = 1,2


    Q_ONLY_ACTIVE_ARCH.name = ONLY_ACTIVE_ARCH

    Q_ONLY_ACTIVE_ARCH.value = YES

    QMAKE_MAC_XCODE_SETTINGS += Q_ONLY_ACTIVE_ARCH

    unset(QMAKE_XCODE_ARCHS)


    Q_CLANG_WARN_BOOL_CONVERSION.name = CLANG_WARN_BOOL_CONVERSION

    Q_CLANG_WARN_BOOL_CONVERSION.value = YES

    QMAKE_MAC_XCODE_SETTINGS += Q_CLANG_WARN_BOOL_CONVERSION


    Q_CLANG_WARN_CONSTANT_CONVERSION.name = CLANG_WARN_CONSTANT_CONVERSION

    Q_CLANG_WARN_CONSTANT_CONVERSION.value = YES

    QMAKE_MAC_XCODE_SETTINGS += Q_CLANG_WARN_CONSTANT_CONVERSION


    Q_CLANG_WARN_EMPTY_BODY.name = CLANG_WARN_EMPTY_BODY

    Q_CLANG_WARN_EMPTY_BODY.value = YES

    QMAKE_MAC_XCODE_SETTINGS += Q_CLANG_WARN_EMPTY_BODY


    Q_CLANG_WARN_ENUM_CONVERSION.name = CLANG_WARN_ENUM_CONVERSION

    Q_CLANG_WARN_ENUM_CONVERSION.value = YES

    QMAKE_MAC_XCODE_SETTINGS += Q_CLANG_WARN_ENUM_CONVERSION


    Q_CLANG_WARN_INT_CONVERSION.name = CLANG_WARN_INT_CONVERSION

    Q_CLANG_WARN_INT_CONVERSION.value = YES

    QMAKE_MAC_XCODE_SETTINGS += Q_CLANG_WARN_INT_CONVERSION


    Q_CLANG_WARN_UNREACHABLE_CODE.name = CLANG_WARN_UNREACHABLE_CODE

    Q_CLANG_WARN_UNREACHABLE_CODE.value = YES

    QMAKE_MAC_XCODE_SETTINGS += Q_CLANG_WARN_UNREACHABLE_CODE


    Q_CLANG_WARN__DUPLICATE_METHOD_MATCH.name = CLANG_WARN__DUPLICATE_METHOD_MATCH

    Q_CLANG_WARN__DUPLICATE_METHOD_MATCH.value = YES

    QMAKE_MAC_XCODE_SETTINGS += Q_CLANG_WARN__DUPLICATE_METHOD_MATCH


    Q_ENABLE_STRICT_OBJC_MSGSEND.name = ENABLE_STRICT_OBJC_MSGSEND

    Q_ENABLE_STRICT_OBJC_MSGSEND.value = YES

    QMAKE_MAC_XCODE_SETTINGS += Q_ENABLE_STRICT_OBJC_MSGSEND


    Q_GCC_NO_COMMON_BLOCKS.name = GCC_NO_COMMON_BLOCKS

    Q_GCC_NO_COMMON_BLOCKS.value = YES

    QMAKE_MAC_XCODE_SETTINGS += Q_GCC_NO_COMMON_BLOCKS


    Q_GCC_WARN_64_TO_32_BIT_CONVERSION.name = GCC_WARN_64_TO_32_BIT_CONVERSION

    Q_GCC_WARN_64_TO_32_BIT_CONVERSION.value = YES

    QMAKE_MAC_XCODE_SETTINGS += Q_GCC_WARN_64_TO_32_BIT_CONVERSION


    Q_GCC_WARN_ABOUT_RETURN_TYPE.name = GCC_WARN_ABOUT_RETURN_TYPE

    Q_GCC_WARN_ABOUT_RETURN_TYPE.value = YES

    QMAKE_MAC_XCODE_SETTINGS += Q_GCC_WARN_ABOUT_RETURN_TYPE


    Q_GCC_WARN_UNDECLARED_SELECTOR.name = GCC_WARN_UNDECLARED_SELECTOR

    Q_GCC_WARN_UNDECLARED_SELECTOR.value = YES

    QMAKE_MAC_XCODE_SETTINGS += Q_GCC_WARN_UNDECLARED_SELECTOR


    Q_GCC_WARN_UNINITIALIZED_AUTOS.name = GCC_WARN_UNINITIALIZED_AUTOS

    Q_GCC_WARN_UNINITIALIZED_AUTOS.value = YES

    QMAKE_MAC_XCODE_SETTINGS += Q_GCC_WARN_UNINITIALIZED_AUTOS


    Q_GCC_WARN_UNUSED_FUNCTION.name = GCC_WARN_UNUSED_FUNCTION

    Q_GCC_WARN_UNUSED_FUNCTION.value = YES

    QMAKE_MAC_XCODE_SETTINGS += Q_GCC_WARN_UNUSED_FUNCTION


    Q_GCC_WARN_UNUSED_VARIABLE.name = GCC_WARN_UNUSED_VARIABLE

    Q_GCC_WARN_UNUSED_VARIABLE.value = YES

    QMAKE_MAC_XCODE_SETTINGS += Q_GCC_WARN_UNUSED_VARIABLE



}

-Ed


[cid:985C91CA-0A67-4ED0-AE77-E22FBF9739FE at ditchwitch.cmw.internal]


ED SUTTON · PRODUCT ENGINEER - SOFTWARE
PH: 580-572-3090
edward.sutton at subsite.com<mailto:edward.sutton at subsite.com>

1950 W. Fir Street · Perry, OK 73077 USA
PH: 800-846-2713 · subsite.com<http://subsite.com/>






On Apr 29, 2015, at 3:02 PM, Edward Sutton <edward.sutton at subsite.com<mailto:edward.sutton at subsite.com>> wrote:

When Xcode 6.3.1 opens an Xcode project created by Qt, it has issues when Product->Analyze checker is executed.

Under issue “Validate Project Settings” it recommends “Update to recommended settings”
   -  These issues are compiler flags.

I fixed another issue using QMAKE_IOS_DEPLOYMENT_TARGET and QMAKE_IOS_TARGETED_DEVICE_FAMILY.

None of the QMAKE_IOS_GCC_WARN* variables are seen the Qt Creator Compile Output window. They have no effect on the Xcode project.



    # Set "Target"

    QMAKE_IOS_DEPLOYMENT_TARGET = 6.0


    # Set "Devices" (2=iPad Only)

    # Note for devices: 1=iPhone, 2=iPad, 1,2=Universal.

    QMAKE_IOS_TARGETED_DEVICE_FAMILY = 2




    # These

    QMAKE_IOS_CLANG_WARN_BOOL_CONVERSION = YES

    QMAKE_IOS_CLANG_WARN_CONSTANT_CONVERSION = YES

    QMAKE_IOS_CLANG_WARN_EMPTY_BODY = YES

    QMAKE_IOS_CLANG_WARN_ENUM_CONVERSION = YES

    QMAKE_IOS_CLANG_WARN_INT_CONVERSION = YES

    QMAKE_IOS_CLANG_WARN_UNREACHABLE_CODE = YES

    QMAKE_IOS_CLANG_WARN__DUPLICATE_METHOD_MATCH = YES


    QMAKE_IOS_GCC_WARN_64_TO_32_BIT_CONVERSION = YES

    QMAKE_IOS_GCC_WARN_ABOUT_RETURN_TYPE = YES

    QMAKE_IOS_GCC_WARN_UNDECLARED_SELECTOR = YES

    QMAKE_IOS_GCC_WARN_UNINITIALIZED_AUTOS = YES

    QMAKE_IOS_GCC_WARN_UNUSED_FUNCTION = YES

    QMAKE_IOS_GCC_WARN_UNUSED_VARIABLE = YES


When I let Xcode fix and “Update to recommended settings”, the diff between the project.pbxproj and project-fixed.pbxproj files are basically:

CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = YES;
DYLIB_COMPATIBILITY_VERSION = 1.0;
DYLIB_CURRENT_VERSION = 1.0.0;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;

Has anyone figured out how to pass these from make to Xcode project?

-Ed


This email and any files transmitted with it from The Charles Machine Works, Inc. are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error please notify the sender. Our company accepts no liability for the contents of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
_______________________________________________
Interest mailing list
Interest at qt-project.org<mailto:Interest at qt-project.org>
http://lists.qt-project.org/mailman/listinfo/interest

This email and any files transmitted with it from The Charles Machine Works, Inc. are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error please notify the sender. Our company accepts no liability for the contents of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150430/09b07cf4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unknown.jpg
Type: image/jpeg
Size: 9416 bytes
Desc: unknown.jpg
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150430/09b07cf4/attachment.jpg>


More information about the Interest mailing list