Skip to content

Commit 1e38e75

Browse files
author
minggo
committed
Merge pull request #26 from andyque/add-gafplayer
Add gafplayer and fix Android toolchain missing c++ STL header file
2 parents 30753d3 + 85237ca commit 1e38e75

File tree

8 files changed

+57
-9
lines changed

8 files changed

+57
-9
lines changed

build/android.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ cfg_armv7_toolchain_bin="${ANDROID_NDK}/toolchains/arm-linux-androideabi-${cfg_d
2929

3030
#build arches and build libraries
3131
cfg_all_supported_arches=("arm" "armv7" "x86" "arm64")
32-
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl")
32+
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "gafplayer")
3333
cfg_default_arches_all=("arm" "armv7" "x86" "arm64")
34-
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl")
34+
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "gafplayer")
3535

3636

3737
#whether build fat library, use lipo -S create

build/build.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,9 @@ function set_build_mode_cflags()
270270
export OPTIM
271271
}
272272

273+
if [ $cfg_platform_name = "mac" ];then
274+
export MIN_MACOSX_TARGET=$cfg_min_macosx_deoply_tartget
275+
fi
273276

274277

275278
# build all the libraries for different arches

build/ios.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ cfg_armv7s_host_machine="arm-apple-darwin"
1414
cfg_arm64_host_machine="arm-apple-darwin"
1515

1616
cfg_all_supported_arches=("armv7" "armv7s" "i386" "arm64" "x86_64")
17-
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl")
17+
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "gafplayer")
1818
cfg_default_arches_all=("armv7" "armv7s" "i386" "arm64" "x86_64")
19-
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl")
19+
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "gafplayer")
2020

2121

2222
cfg_build_fat_library=yes

build/linux.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ cfg_i386_host_machine="i386-linux-gnu"
1717

1818

1919
cfg_all_supported_arches=("i386" "x86_64")
20-
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl")
20+
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "gafplayer")
2121
cfg_default_arches_all=("x86_64")
22-
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl")
22+
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "openssl" "gafplayer")
2323

2424

2525
cfg_build_fat_library=no

build/mac.ini

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@ cfg_build_machine="x86_64-apple-darwin14"
1212
cfg_x86_64_host_machine="x86_64-apple-darwin"
1313
cfg_i386_host_machine="i386-apple-darwin"
1414

15+
cfg_min_macosx_deoply_tartget=10.7
16+
1517
#cross compile options
1618
cfg_is_cross_compile=no
1719
# cfg_armv7_toolchain_bin=
1820

1921
#build arches and build libraries
2022
cfg_all_supported_arches=("i386" "x86_64")
21-
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "glfw" "openssl")
23+
cfg_all_supported_libraries=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "glfw" "openssl" "gafplayer")
2224
cfg_default_arches_all=("x86_64" "i386")
23-
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "glfw" "openssl")
25+
cfg_default_libraries_all=("png" "zlib" "lua" "luajit" "websockets" "curl" "freetype" "jpeg" "tiff" "webp" "chipmunk" "glfw" "openssl" "gafplayer")
2426

2527

2628
#whether build fat library, use lipo -S create

build/main.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ webp_header_files=webp
1414
websockets_header_files=libwebsockets.h
1515
zlib_header_files=z*.h
1616
chipmunk_header_files=chipmunk
17+
gafplayer_header_files=GAFPlayer
1718

1819

1920
##archive prebuilt name

contrib/src/gafplayer/rules.mak

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# gafplayer
2+
3+
GAFPLAYER_GITURL := [email protected]:andyque/Cocos2dxGAFPlayer.git
4+
5+
$(TARBALLS)/gafplayer-git.tar.xz:
6+
$(call download_git,$(GAFPLAYER_GITURL),addCMakeSupport)
7+
8+
9+
.sum-gafplayer: gafplayer-git.tar.xz
10+
$(warning $@ not implemented)
11+
touch $@
12+
13+
gafplayer: gafplayer-git.tar.xz .sum-gafplayer
14+
$(UNPACK)
15+
$(MOVE)
16+
17+
ifdef HAVE_TIZEN
18+
EX_ECFLAGS = -fPIC
19+
endif
20+
21+
ifdef HAVE_MACOSX
22+
CMAKE_DEFINE=MACOX
23+
endif
24+
25+
ifdef HAVE_IOS
26+
CMAKE_DEFINE=IOS
27+
endif
28+
29+
ifdef HAVE_ANDROID
30+
CMAKE_DEFINE=ANDROID
31+
endif
32+
33+
ifdef HAVE_LINUX
34+
CMAKE_DEFINE=LINUX
35+
endif
36+
37+
.gafplayer: gafplayer toolchain.cmake
38+
cd $</Library && $(HOSTVARS) CFLAGS="$(CFLAGS) $(EX_ECFLAGS)" ${CMAKE} -D${CMAKE_DEFINE}=1
39+
cd $</Library && $(MAKE) VERBOSE=1 install
40+
touch $@

contrib/src/main.mak

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ CXX := ${HOST}-g++ --sysroot=$(TIZEN_SDK)/platforms/mobile-2.3/rootstraps/mobile
9999
endif
100100

101101
ifdef HAVE_MACOSX
102-
MIN_OSX_VERSION=10.6
102+
MIN_OSX_VERSION=${MIN_MACOSX_TARGET}
103103
CC=xcrun cc
104104
CXX=xcrun c++
105105
AR=xcrun ar
@@ -419,6 +419,8 @@ ifdef HAVE_ANDROID
419419
echo "set(CMAKE_SYSTEM_NAME Linux)" >> $@
420420
echo "set(CMAKE_CXX_SYSROOT_FLAG \"\")" >> $@
421421
echo "set(CMAKE_C_SYSROOT_FLAG \"\")" >> $@
422+
echo "include_directories($(ANDROID_NDK)/sources/android/support/include \
423+
$(ANDROID_NDK)/sources/cxx-stl/llvm-libc++/libcxx/include)" >> $@
422424
endif
423425
ifdef HAVE_TIZEN
424426
echo "set(CMAKE_SYSTEM_NAME Linux)" >> $@

0 commit comments

Comments
 (0)