[ios] Updated mkspecs to support x86_64 architecture.

This commit is contained in:
Ilya Grechuhin 2016-10-26 14:31:41 +03:00
parent a849a297f0
commit 9bffffc05f
3 changed files with 32 additions and 21 deletions

View file

@ -69,7 +69,7 @@ QMAKE_CFLAGS += -isystem $$IPHONE_SDK_PATH/usr/include
QMAKE_CFLAGS += -iwithsysroot $$IPHONE_SDK_PATH
#QMAKE_CFLAGS += -iwithsysroot $$IPHONE_SDK_PATH/System/Library/Frameworks/
QMAKE_CFLAGS += -fmessage-length=0
QMAKE_CFLAGS += -pipe -miphoneos-version-min=7.0 -Wno-deprecated-register
QMAKE_CFLAGS += -pipe -miphoneos-version-min=8.0 -Wno-deprecated-register
QMAKE_CFLAGS_DEPS += -M
QMAKE_CFLAGS_WARN_ON += -Wall -W
QMAKE_CFLAGS_WARN_OFF += -w
@ -82,9 +82,11 @@ QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden
QMAKE_CFLAGS_PRECOMPILE += -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
QMAKE_CFLAGS_USE_PRECOMPILE += -include ${QMAKE_PCH_OUTPUT_BASE}
QMAKE_CFLAGS_X86 += -arch i386
QMAKE_OBJECTIVE_CFLAGS_X86 += -arch i386
QMAKE_CFLAGS_DWARF2 += -gdwarf-2
QMAKE_CFLAGS_X86 += -arch i386
QMAKE_CFLAGS_X86_64 += -arch x86_64
QMAKE_OBJECTIVE_CFLAGS_X86 += -arch i386
QMAKE_OBJECTIVE_CFLAGS_X86_64 += -arch x86_64
QMAKE_CFLAGS_DWARF2 += -gdwarf-2
QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_CFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch $$QMAKE_CFLAGS_HIDESYMS -std=c++11 -stdlib=libc++
@ -100,6 +102,7 @@ QMAKE_CXXFLAGS_YACC += $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden
QMAKE_CXXFLAGS_PPC += -arch ppc
QMAKE_CXXFLAGS_X86 += -arch i386
QMAKE_CXXFLAGS_X86_64 += -arch x86_64
QMAKE_CXXFLAGS_DWARF2 += $$QMAKE_CFLAGS_DWARF2
QMAKE_CXXFLAGS_PRECOMPILE += -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
@ -110,7 +113,7 @@ QMAKE_LINK = $$QMAKE_CXX
QMAKE_LINK_SHLIB = $$QMAKE_CXX
QMAKE_LINK_C = $$QMAKE_CC
QMAKE_LINK_C_SHLIB = $$QMAKE_CC
QMAKE_LFLAGS += -stdlib=libc++ -miphoneos-version-min=7.0 -headerpad_max_install_names -Xlinker "-syslibroot $$IPHONE_SDK_PATH"
QMAKE_LFLAGS += -stdlib=libc++ -miphoneos-version-min=8.0 -headerpad_max_install_names -Xlinker "-syslibroot $$IPHONE_SDK_PATH"
QMAKE_LFLAGS_RELEASE += -O3
QMAKE_LFLAGS_DEBUG +=
QMAKE_LFLAGS_APP +=
@ -121,6 +124,7 @@ QMAKE_LFLAGS_INCREMENTAL += -undefined suppress -flat_namespace
QMAKE_LFLAGS_SONAME += -install_name$${LITERAL_WHITESPACE}
QMAKE_LFLAGS_PPC += -arch ppc
QMAKE_LFLAGS_X86 += -arch i386
QMAKE_LFLAGS_X86_64 += -arch x86_64
QMAKE_LFLAGS_VERSION += -current_version$${LITERAL_WHITESPACE}
QMAKE_LFLAGS_COMPAT_VERSION += -compatibility_version$${LITERAL_WHITESPACE}
# -all_load requred to make Objective-C categories work in static builds.

View file

@ -6,32 +6,35 @@
# to include /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin
# where gcc an all tools are actually resides
IPHONE_SDK_PATH = $$(SDK_ROOT)
IPHONE_SDK_PATH = $$(SDK_ROOT)
isEmpty( IPHONE_SDK_PATH ) : error(Please set SDK_ROOT environment variable)
BUILD_ARCH = $$(BUILD_ARCHITECTURE)
isEmpty( BUILD_ARCH ) : error(Please check that BUILD_ARCHITECTURE environment variable is set)
MAKEFILE_GENERATOR = UNIX
TEMPLATE = app
CONFIG += x86 hide_symbols warn_on dwarf2 app_bundle incremental global_init_link_order lib_version_first plugin_no_soname link_prl
CONFIG += hide_symbols warn_on dwarf2 app_bundle incremental global_init_link_order lib_version_first plugin_no_soname link_prl
QMAKE_INCREMENTAL_STYLE = sublib
QMAKE_COMPILER = clang
QMAKE_CC = clang
QMAKE_CXX = clang++
QMAKE_CC = clang -arch $$BUILD_ARCH
QMAKE_CXX = clang++ -arch $$BUILD_ARCH
QMAKE_OBJECTIVE_CC = $$QMAKE_CC -fobjc-abi-version=2 -fobjc-legacy-dispatch
QMAKE_RESOURCE =
QMAKE_RESOURCE =
QMAKE_EXTENSION_SHLIB = dylib
QMAKE_LIBDIR =
QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS]
QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS]
QMAKE_INCDIR_OPENGL =
QMAKE_INCDIR_OPENGL =
QMAKE_FIX_RPATH = install_name_tool -id
QMAKE_LIBS_DYNLOAD =
QMAKE_LIBS_OPENGL =
QMAKE_LIBS_OPENGL =
QMAKE_LIBS_OPENGL_QT = $$QMAKE_LIBS_OPENGL
QMAKE_LIBS_THREAD =
@ -39,7 +42,7 @@ QMAKE_MOC = $$[QT_INSTALL_BINS]/moc
QMAKE_UIC = $$[QT_INSTALL_BINS]/uic
#QMAKE_AR = ar cq
QMAKE_AR = libtool -static -arch_only i386 -syslibroot $$IPHONE_SDK_PATH -o
QMAKE_AR = libtool -static -syslibroot $$IPHONE_SDK_PATH -o
#QMAKE_RANLIB = ranlib -s
QMAKE_TAR = tar -cf
@ -59,9 +62,9 @@ QMAKE_PREFIX_STATICLIB = lib
QMAKE_EXTENSION_STATICLIB = a
QMAKE_COMPILER_DEFINES +=
DEFINES += __IPHONE_OS_VERSION_MIN_REQUIRED=70000
DEFINES += __IPHONE_OS_VERSION_MIN_REQUIRED=80000
QMAKE_CFLAGS += --sysroot=$$IPHONE_SDK_PATH -fmessage-length=0 -fpascal-strings -fasm-blocks
QMAKE_CFLAGS += -pipe -arch i386 -mios-simulator-version-min=7.0 -Wno-deprecated-register
QMAKE_CFLAGS += -pipe -mios-simulator-version-min=8.0 -Wno-deprecated-register
QMAKE_CFLAGS_DEPS += -M
QMAKE_CFLAGS_WARN_ON += -Wall -W
QMAKE_CFLAGS_WARN_OFF += -w
@ -74,9 +77,11 @@ QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden
QMAKE_CFLAGS_PRECOMPILE += -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
QMAKE_CFLAGS_USE_PRECOMPILE += -include ${QMAKE_PCH_OUTPUT_BASE}
QMAKE_CFLAGS_X86 += -arch i386
QMAKE_OBJECTIVE_CFLAGS_X86 += -arch i386
QMAKE_CFLAGS_DWARF2 += -gdwarf-2
QMAKE_CFLAGS_X86 += -arch i386
QMAKE_CFLAGS_X86_64 += -arch x86_64
QMAKE_OBJECTIVE_CFLAGS_X86 += -arch i386
QMAKE_OBJECTIVE_CFLAGS_X86_64 += -arch x86_64
QMAKE_CFLAGS_DWARF2 += -gdwarf-2
QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_CFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch -std=c++11 -stdlib=libc++
@ -92,6 +97,7 @@ QMAKE_CXXFLAGS_YACC += $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden
QMAKE_CXXFLAGS_PPC += -arch ppc
QMAKE_CXXFLAGS_X86 += -arch i386
QMAKE_CXXFLAGS_X86_64 += -arch x86_64
QMAKE_CXXFLAGS_DWARF2 += $$QMAKE_CFLAGS_DWARF2
QMAKE_CXXFLAGS_PRECOMPILE += -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
@ -102,7 +108,7 @@ QMAKE_LINK = $$QMAKE_CXX
QMAKE_LINK_SHLIB = $$QMAKE_CXX
QMAKE_LINK_C = $$QMAKE_CC
QMAKE_LINK_C_SHLIB = $$QMAKE_CC
QMAKE_LFLAGS += -headerpad_max_install_names -stdlib=libc++ -mios-simulator-version-min=7.0
QMAKE_LFLAGS += -headerpad_max_install_names -stdlib=libc++ -mios-simulator-version-min=8.0
QMAKE_LFLAGS_RELEASE +=
QMAKE_LFLAGS_DEBUG +=
QMAKE_LFLAGS_APP +=
@ -113,6 +119,7 @@ QMAKE_LFLAGS_INCREMENTAL += -undefined suppress -flat_namespace
QMAKE_LFLAGS_SONAME += -install_name$${LITERAL_WHITESPACE}
QMAKE_LFLAGS_PPC += -arch ppc
QMAKE_LFLAGS_X86 += -arch i386
QMAKE_LFLAGS_X86_64 += -arch x86_64
QMAKE_LFLAGS_VERSION += -current_version$${LITERAL_WHITESPACE}
QMAKE_LFLAGS_COMPAT_VERSION += -compatibility_version$${LITERAL_WHITESPACE}
# -all_load requred to make Objective-C categories work in static builds.

View file

@ -12,7 +12,7 @@ export PATH=$DEV_ROOT/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin
export CC="gcc-4.2"
export CXX="g++-4.2"
C_AND_CXX_FLAGS="-arch i386 -fmessage-length=0 -pipe -fpascal-strings -fasm-blocks -Wall \
C_AND_CXX_FLAGS="-arch i386 x86_64 -fmessage-length=0 -pipe -fpascal-strings -fasm-blocks -Wall \
-fvisibility=hidden -mmacosx-version-min=10.6 -gdwarf-2 \
-D__IPHONE_OS_VERSION_MIN_REQUIRED=$IOS_VERSION \
-isysroot $SDK_ROOT -isystem $SDK_ROOT/usr/include"
@ -23,5 +23,5 @@ export CXXFLAGS="$C_AND_CXX_FLAGS -fvisibility-inlines-hidden"
# linker settings
export MACOSX_DEPLOYMENT_TARGET=10.6
# just to mention - this flag is passed to libtool, not to gcc
LIBTOOL_FLAGS="-arch_only i386 -syslibroot $SDK_ROOT"
LIBTOOL_FLAGS="-syslibroot $SDK_ROOT"
LDFLAGS="-L$SDK_ROOT/usr/lib"