Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / include / makeinclude / platform_macosx_iOS.GNU
blob3b375e5db0a1ff4d3d75eae68dc758580929013e
2 static_libs_only=1
4 include $(ACE_ROOT)/include/makeinclude/platform_macosx_common.GNU
6 ifneq (,$(XCODE_ROOT))
7   XCODE:=$(XCODE_ROOT)
8 else
9   XCODE:=/Applications/Xcode.app
10 endif
12 ifndef IPHONE_TARGET
13   $(error Please set IPHONE_TARGET to SIMULATOR or HARDWARE)
14 endif
16 ifeq ($(IPHONE_TARGET), SIMULATOR)
17   CROSS-COMPILE=1
18   IPHONE_PLATFORM:=$(XCODE)/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
19   IPHONE_SDK:=$(IPHONE_PLATFORM)/SDKs/iPhoneSimulator${IPHONE_VERSION}.sdk
20   IPHONE_HARDWARE_ARCHITECTURE=x86_64
22 # June 2017 release, iPhone 6s and later
23   CFLAGS  += -miphoneos-version-min=12.0
24   CCFLAGS += -miphoneos-version-min=12.0
25   LDFLAGS += -miphoneos-version-min=12.0
26 endif
28 ifeq ($(IPHONE_TARGET), HARDWARE)
29   CROSS-COMPILE=1
30   IPHONE_PLATFORM:=$(XCODE)/Contents/Developer/Platforms/iPhoneOS.platform/Developer
31   IPHONE_SDK:=$(IPHONE_PLATFORM)/SDKs/iPhoneOS${IPHONE_VERSION}.sdk
32 # arm64 iPhone 6 and later
33   IPHONE_HARDWARE_ARCHITECTURE=arm64
35 ifeq ($(iphone_bitcode),1)
36 # enable bitcode
37   CFLAGS  += -fembed-bitcode
38   CCFLAGS += -fembed-bitcode
39 endif
41 ifeq ($(iphone_codesign),1)
42   CODESIGN_ALLOCATE:=$(IPHONE_PLATFORM)/usr/bin/codesign_allocate
43   POSTLINK=; codesign -f -s "iPhone Developer" $(BIN)
44 endif
45   rwho = 0
46 endif
48 # pass a flag to the preprocessor
49 CFLAGS  += -DACE_HAS_IOS
50 CCFLAGS += -DACE_HAS_IOS
52 CC:=$(XCODE)/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
53 CXX:=$(XCODE)/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
54 AR:=$(XCODE)/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar
55 ARFLAGS = rSv
56 RANLIB:=$(XCODE)/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib -no_warning_for_no_symbols
57 DLD = $(CXX)
58 LD  = $(CXX)
59 CFLAGS  += -arch $(IPHONE_HARDWARE_ARCHITECTURE) -isysroot $(IPHONE_SDK)
60 CCFLAGS += -arch $(IPHONE_HARDWARE_ARCHITECTURE) -isysroot $(IPHONE_SDK)
62 ifneq (,$(HOST_ROOT))
63   TAO_IDLFLAGS += -g $(HOST_ROOT)/bin/ace_gperf
64   TAO_IDL = $(HOST_ROOT)/bin/tao_idl
65   TAO_IDL_DEP = $(TAO_IDL)
66   # make sure to use the target compiler, not the cross-compiler
67   # as preprocessor for the cross-compiled idl tools
68   TAO_IDL_PREPROCESSOR = clang
69 endif