mac和ios通用编译环境

  1. 1、MAC编译环境配置
  2. 2、ios编译环境配置
  3. THE END!

1、MAC编译环境配置

mac32:

ifeq ( $(findstring mac32, $(platform)), mac32)
CC = gcc
CPP = g++
LD = ld
AR = ar
CFLAGS += -fPIC -arch i386 -m32
LDFLAGS += -Wl,  -Bsymbolic-functions
LDFLAGS += -m32 -read_only_relocs suppress
endif

mac64:

ifeq ( $(findstring mac64, $(platform)), mac64)
CC = gcc
CPP = g++
LD = ld
AR = ar
CFLAGS += -fPIC  -arch x86_64  -m64
LDFLAGS += -Wl,  -Bsymbolic-functions -m64
LDFLAGS += -m64 -read_only_relocs suppress
endif

2、ios编译环境配置

ios32:

ifeq ( $(findstring ios32, $(platform)), ios32)
CC = xcrun -sdk iphoneos clang
CPP = xcrun -sdk iphoneos clang
AR = ar
CFLAGS += -arch armv7 -mios-version-min=6.0  -march=armv7-a
LDFLAGS += -arch armv7 -mios-version-min=6.0  -march=armv7-a  -Wl,  -Bsymbolic-functions -read_only_relocs suppress
endif

ios64:

ifeq ( $(findstring ios64, $(platform)), ios64)
CC = xcrun -sdk iphoneos clang
CPP = xcrun -sdk iphoneos clang
AR = ar
CFLAGS += -Wall -O3 -arch arm64 -mios-version-min=6.0  
LDFLAGS += -arch arm64 -mios-version-min=6.0   -Wl,  -Bsymbolic-functions
endif

i386模拟器环境:

ifeq ( $(findstring ios_i386, $(platform)), ios_i386)
CC = xcrun -sdk iphonesimulator clang
CPP = xcrun -sdk iphonesimulator clang
AR = ar
CFLAGS += -Wall -O3 -arch i386 -mios-simulator-version-min=6.0  -DIOS
LDFLAGS += -arch i386  -mios-simulator-version-min=6.0   -Wl,  -Bsymbolic-functions
endif

x86_64模拟器环境:

ifeq ( $(findstring ios_x86_64, $(platform)), ios_x86_64)
CC = xcrun -sdk iphonesimulator clang
CPP = xcrun -sdk iphonesimulator clang
AR = ar
CFLAGS += -Wall -O3 -arch x86_64 -mios-simulator-version-min=6.0  -DIOS
LDFLAGS += -arch x86_64 -mios-simulator-version-min=6.0   -Wl,  -Bsymbolic-functions
endif

THE END!


本博文只能阅读,谢绝转载,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 2963033731@qq.com

文章标题:mac和ios通用编译环境

字数:270

本文作者:Soaring Lee

发布时间:2018-09-26, 21:45:47

最后更新:2021-06-14, 12:13:44

原始链接:https://soaringleefighting.github.io/2018/09/26/【PE系列】mac和ios通用编译环境/

版权声明: "署名-非商用-相同方式共享 4.0" 转载请保留原文链接及作者。

×

喜欢就点赞,疼爱就打赏

相册