Skip to content

Commit b9df8ad

Browse files
crazyhappygameminggo
authored andcommitted
remove_ios.toolchain.cmake (#20058)
* remove_ios.toolchain.cmake * simplify osx configuration * Remove ios.toolchain.cmake
1 parent 4d0e76b commit b9df8ad

File tree

5 files changed

+35
-268
lines changed

5 files changed

+35
-268
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ matrix:
1515
- os: osx
1616
env: BUILD_TARGET=mac_cmake
1717
language: cpp
18-
osx_image: xcode9.3
18+
osx_image: xcode10.3
1919
sudo: required
2020
# iOS_cmake
2121
- os: osx

cmake/Modules/CocosConfigDefine.cmake

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
1+
If(APPLE)
2+
if(${CMAKE_VERSION} VERSION_LESS "3.14")
3+
message(FATAL_ERROR "Please use CMake 3.14 or newer for Apple platform (macOS, iOS, tvOS or watchOS)")
4+
endif()
5+
endif()
6+
17
#Please use them everywhere
28
#WINDOWS = Windows Desktop
39
#ANDROID = Android
410
#IOS = iOS
511
#MACOSX = MacOS X
612
#LINUX = Linux
7-
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
8-
set(WINDOWS TRUE)
9-
set(PLATFORM_FOLDER win32)
10-
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Android")
11-
set(PLATFORM_FOLDER android)
12-
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
13-
if(ANDROID)
14-
set(PLATFORM_FOLDER android)
15-
else()
16-
set(LINUX TRUE)
17-
set(PLATFORM_FOLDER linux)
18-
endif()
19-
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
20-
if(IOS)
21-
set(APPLE TRUE)
22-
set(PLATFORM_FOLDER ios)
23-
else()
24-
set(APPLE TRUE)
25-
set(MACOSX TRUE)
26-
set(PLATFORM_FOLDER mac)
27-
endif()
28-
else()
29-
message(FATAL_ERROR "Unsupported platform, CMake will exit")
30-
return()
31-
endif()
13+
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
14+
set(WINDOWS TRUE)
15+
set(PLATFORM_FOLDER win32)
16+
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Android")
17+
set(PLATFORM_FOLDER android)
18+
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
19+
if(ANDROID)
20+
set(PLATFORM_FOLDER android)
21+
else()
22+
set(LINUX TRUE)
23+
set(PLATFORM_FOLDER linux)
24+
endif()
25+
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
26+
set(APPLE TRUE)
27+
set(MACOSX TRUE)
28+
set(PLATFORM_FOLDER mac)
29+
elseif(${CMAKE_SYSTEM_NAME} MATCHES "iOS")
30+
set(APPLE TRUE)
31+
set(IOS TRUE)
32+
set(PLATFORM_FOLDER ios)
33+
else()
34+
message(FATAL_ERROR "Unsupported platform, CMake will exit")
35+
return()
36+
endif()
3237

3338
# generators that are capable of organizing into a hierarchy of folders
3439
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

cmake/ios.toolchain.cmake

Lines changed: 0 additions & 216 deletions
This file was deleted.

tools/travis-scripts/before-install.sh

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,6 @@ function install_python_module_for_osx()
4141
sudo pip install Cheetah
4242
}
4343

44-
function install_latest_python()
45-
{
46-
python -V
47-
eval "$(pyenv init -)"
48-
pyenv install 2.7.14
49-
pyenv global 2.7.14
50-
python -V
51-
}
52-
53-
function install_cmake_osx()
54-
{
55-
cmake --version
56-
brew upgrade cmake
57-
cmake --version
58-
}
59-
6044
# set up environment according os and target
6145
function install_environement_for_pull_request()
6246
{
@@ -72,9 +56,7 @@ function install_environement_for_pull_request()
7256
fi
7357

7458
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
75-
install_latest_python
7659
install_python_module_for_osx
77-
install_cmake_osx
7860
fi
7961

8062
# use NDK's clang to generate binding codes
@@ -86,16 +68,17 @@ function install_environement_for_pull_request()
8668
function install_environement_for_after_merge()
8769
{
8870
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
89-
install_latest_python
9071
install_python_module_for_osx
91-
install_cmake_osx
9272
fi
9373

9474
echo "Building merge commit ..."
9575
install_android_ndk
9676
download_deps
9777
}
9878

79+
cmake --version
80+
python -V
81+
9982
if [ "$BUILD_TARGET" == "android_cocos_new_test" ]; then
10083
sudo apt-get update
10184
sudo apt-get install ninja-build

tools/travis-scripts/run-script.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function build_ios_cmake()
6868
cd $COCOS2DX_ROOT
6969
mkdir -p ios_cmake_build
7070
cd ios_cmake_build
71-
cmake .. -DCMAKE_TOOLCHAIN_FILE=$COCOS2DX_ROOT/cmake/ios.toolchain.cmake -GXcode -DIOS_PLATFORM=SIMULATOR64
71+
cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator
7272
# too much logs on console when "cmake --build ."
7373
# cmake --build .
7474
xcodebuild -project Cocos2d-x.xcodeproj -alltargets -jobs $NUM_OF_CORES -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" build | xcpretty
@@ -112,11 +112,6 @@ function genernate_binding_codes()
112112
ldd $COCOS2DX_ROOT/tools/bindings-generator/libclang/libclang.so
113113
fi
114114

115-
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
116-
eval "$(pyenv init -)"
117-
fi
118-
which python
119-
120115
source ../environment.sh
121116

122117
# Generate binding glue codes

0 commit comments

Comments
 (0)