@@ -33,10 +33,10 @@ function build_linux()
33
33
echo " Building tests ..."
34
34
source ../environment.sh
35
35
cd $COCOS2DX_ROOT
36
- mkdir -p linux-build
37
- cd linux- build
38
- cmake ..
39
- cmake --build .
36
+ set -x
37
+ cmake . -G " Unix Makefiles " -Blinux- build-release -DCMAKE_BUILD_TYPE=Release
38
+ cmake --build linux-build-release -- -j ` nproc `
39
+ set +x
40
40
}
41
41
42
42
function build_mac_cmake()
@@ -51,10 +51,10 @@ function build_mac_cmake()
51
51
mkdir -p mac_cmake_build
52
52
cd mac_cmake_build
53
53
cmake .. -GXcode
54
- # cmake --build .
55
- xcodebuild -project Cocos2d-x.xcodeproj -alltargets -jobs $NUM_OF_CORES build | xcpretty
56
- # the following commands must not be removed
57
- xcodebuild -project Cocos2d-x.xcodeproj -alltargets -jobs $NUM_OF_CORES build
54
+ cmake --build . --config Release -- -quiet
55
+ # xcodebuild -project Cocos2d-x.xcodeproj -alltargets -jobs $NUM_OF_CORES build | xcpretty
56
+ # # the following commands must not be removed
57
+ # xcodebuild -project Cocos2d-x.xcodeproj -alltargets -jobs $NUM_OF_CORES build
58
58
exit 0
59
59
}
60
60
@@ -71,10 +71,11 @@ function build_ios_cmake()
71
71
cd ios_cmake_build
72
72
cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator
73
73
# too much logs on console when "cmake --build ."
74
- # cmake --build .
75
- xcodebuild -project Cocos2d-x.xcodeproj -alltargets -jobs $NUM_OF_CORES -destination " platform=iOS Simulator,name=iPhone Retina (4-inch)" build | xcpretty
76
- # the following commands must not be removed
77
- xcodebuild -project Cocos2d-x.xcodeproj -alltargets -jobs $NUM_OF_CORES -destination " platform=iOS Simulator,name=iPhone Retina (4-inch)" build
74
+ cmake --build . --config Release -- -quiet -jobs $NUM_OF_CORES -destination " platform=iOS Simulator,name=iPhone Retina (4-inch)"
75
+
76
+ # xcodebuild -project Cocos2d-x.xcodeproj -alltargets -jobs $NUM_OF_CORES -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" build | xcpretty
77
+ # #the following commands must not be removed
78
+ # xcodebuild -project Cocos2d-x.xcodeproj -alltargets -jobs $NUM_OF_CORES -destination "platform=iOS Simulator,name=iPhone Retina (4-inch)" build
78
79
exit 0
79
80
}
80
81
@@ -215,24 +216,64 @@ function run_pull_request()
215
216
update_cocos_files
216
217
python -u tools/cocos2d-console/bin/cocos.py --agreement n new -l lua -p my.pack.qqqq cocos_new_test
217
218
popd
218
-
219
219
echo " Building tests ..."
220
+
221
+ set -x
220
222
cd $COCOS2DX_ROOT /cocos_new_test
221
223
mkdir -p linux-build
222
224
cd linux-build
223
- cmake ..
224
- cmake --build .
225
+ cmake .. -G" Unix Makefiles"
226
+ cmake --build . -- -j ` nproc`
227
+ exit 0
228
+ fi
229
+
230
+ if [ " $BUILD_TARGET " == " ios_cocos_new_lua_test" ]; then
231
+ export PATH=$PATH :$COCOS2DX_ROOT /tools/cocos2d-console/bin
232
+ # NUM_OF_CORES=`getconf _NPROCESSORS_ONLN`
233
+ genernate_binding_codes
234
+ pushd $COCOS2DX_ROOT
235
+ echo " Creating tests ..."
236
+
237
+ set -x
238
+ cocos --agreement n new -l lua ios_new_lua_proj
239
+ cd ios_new_lua_proj
240
+ mkdir build
241
+ cd build
242
+ cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator
243
+ cmake --build . --config Release -- -quiet
244
+ popd
245
+ exit 0
246
+ fi
247
+
248
+ if [ " $BUILD_TARGET " == " ios_cocos_new_cpp_test" ]; then
249
+ export PATH=$PATH :$COCOS2DX_ROOT /tools/cocos2d-console/bin
250
+ # NUM_OF_CORES=`getconf _NPROCESSORS_ONLN`
251
+ genernate_binding_codes
252
+ pushd $COCOS2DX_ROOT
253
+ echo " Creating tests ..."
254
+
255
+ set -x
256
+ cocos --agreement n new -l cpp ios_new_cpp_proj
257
+ cd ios_new_cpp_proj
258
+ mkdir build
259
+ cd build
260
+ echo " Building tests ..."
261
+ cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator
262
+ cmake --build . --config Release -- -quiet
263
+ popd
225
264
exit 0
226
265
fi
227
266
228
267
if [ $BUILD_TARGET == ' mac_cmake' ]; then
229
268
genernate_binding_codes
269
+ set -x
230
270
build_mac_cmake
231
271
exit 0
232
272
fi
233
273
234
274
if [ $BUILD_TARGET == ' ios_cmake' ]; then
235
275
genernate_binding_codes
276
+ set -x
236
277
build_ios_cmake
237
278
exit 0
238
279
fi
0 commit comments