Travis: build libretro cores

This commit is contained in:
Mahmood - Zer0xFF 2019-06-25 20:59:56 +01:00
parent 1421ae2d27
commit aab8dcab4b
4 changed files with 73 additions and 18 deletions

View File

@ -42,10 +42,18 @@ travis_before_install()
travis_script()
{
if [ "$TARGET_OS" = "Android" ]; then
pushd build_android
./gradlew
./gradlew assembleRelease
popd
if [ "$BUILD_LIBRETRO" = "yes" ]; then
export PATH=/opt/cmake-3.8.1-Linux-x86_64/bin/:$PATH
export ANDROID_NDK=/usr/local/android-sdk/ndk-bundle
pushd build_retro
bash android_build.sh
popd
else
pushd build_android
./gradlew
./gradlew assembleRelease
popd
fi
elif [ "$TARGET_OS" = "Linux_Clang_Format" ]; then
set +e
find ./Source/ ./tools/ -iname *.h -o -iname *.cpp -o -iname *.m -iname *.mm | xargs clang-format-6.0 -i
@ -69,7 +77,7 @@ travis_script()
if [ "$CXX" = "g++" ]; then export CXX="g++-9" CC="gcc-9"; fi
source /opt/qt512/bin/qt512-env.sh || true
export PATH=$PATH:/opt/qt512/lib/cmake
cmake .. -G"$BUILD_TYPE" -DCMAKE_INSTALL_PREFIX=./appdir/usr;
cmake .. -G"$BUILD_TYPE" -DCMAKE_INSTALL_PREFIX=./appdir/usr -DBUILD_LIBRETRO_CORE=yes;
cmake --build .
ctest
cmake --build . --target install
@ -91,13 +99,13 @@ travis_script()
fi
elif [ "$TARGET_OS" = "OSX" ]; then
export CMAKE_PREFIX_PATH="$(brew --prefix qt5)"
cmake .. -G"$BUILD_TYPE"
cmake .. -G"$BUILD_TYPE" -DBUILD_LIBRETRO_CORE=yes
cmake --build . --config Release
ctest -C Release
$(brew --prefix qt5)/bin/macdeployqt Source/ui_qt/Release/Play.app
appdmg ../installer_macosx/spec.json Play.dmg
elif [ "$TARGET_OS" = "IOS" ]; then
cmake .. -G"$BUILD_TYPE" -DCMAKE_TOOLCHAIN_FILE=../deps/Dependencies/cmake-ios/ios.cmake -DTARGET_IOS=ON -DBUILD_PSFPLAYER=ON
cmake .. -G"$BUILD_TYPE" -DCMAKE_TOOLCHAIN_FILE=../deps/Dependencies/cmake-ios/ios.cmake -DTARGET_IOS=ON -DBUILD_PSFPLAYER=ON -DBUILD_LIBRETRO_CORE=yes
cmake --build . --config Release
codesign -s "-" Source/ui_ios/Release-iphoneos/Play.app
pushd ..
@ -125,21 +133,28 @@ travis_before_deploy()
if [ "$TARGET_OS" = "Linux" ]; then
if [ "$TARGET_ARCH" = "x86_64" ]; then
cp ../../build/Play*.AppImage .
cp ../../build/Source/ui_libretro/play_libretro.so play_libretro_linux-x86_64.so
fi;
fi;
if [ "$TARGET_OS" = "Android" ]; then
cp ../../build_android/build/outputs/apk/release/Play-release-unsigned.apk .
export ANDROID_BUILD_TOOLS=$ANDROID_HOME/build-tools/28.0.3
$ANDROID_BUILD_TOOLS/zipalign -v -p 4 Play-release-unsigned.apk Play-release.apk
$ANDROID_BUILD_TOOLS/apksigner sign --ks ../../installer_android/deploy.keystore --ks-key-alias deploy --ks-pass env:ANDROID_KEYSTORE_PASS --key-pass env:ANDROID_KEYSTORE_PASS Play-release.apk
if [ "$BUILD_LIBRETRO" = "yes" ]; then
cp ../../build_retro/play_* .
else
cp ../../build_android/build/outputs/apk/release/Play-release-unsigned.apk .
export ANDROID_BUILD_TOOLS=$ANDROID_HOME/build-tools/28.0.3
$ANDROID_BUILD_TOOLS/zipalign -v -p 4 Play-release-unsigned.apk Play-release.apk
$ANDROID_BUILD_TOOLS/apksigner sign --ks ../../installer_android/deploy.keystore --ks-key-alias deploy --ks-pass env:ANDROID_KEYSTORE_PASS --key-pass env:ANDROID_KEYSTORE_PASS Play-release.apk
fi
fi;
if [ "$TARGET_OS" = "OSX" ]; then
cp ../../build/Play.dmg .
cp ../../build/Source/ui_libretro/play_libretro.dylib play_libretro_macOS-x86_64.dylib
fi;
if [ "$TARGET_OS" = "IOS" ]; then
cp ../../installer_ios/Play.ipa .
cp ../../installer_ios/Play.deb .
cp ../../installer_ios/Packages.bz2 .
cp ../../build/Source/ui_libretro/play_libretro.dylib play_libretro_iOS-FAT.dylib
fi;
popd
popd

View File

@ -43,6 +43,20 @@ matrix:
- build-tools-28.0.3
- android-28
- extra-android-m2repository
- os: linux
dist: trusty
language: android
sudo: required
env:
- TARGET_OS=Android
- BUILD_LIBRETRO=yes
android:
components:
- tools
- platform-tools
- build-tools-28.0.3
- android-28
- extra-android-m2repository
language: cpp

View File

@ -50,15 +50,12 @@ if(BUILD_PLAY)
add_subdirectory(Source/ui_android/)
endif(TARGET_PLATFORM_ANDROID)
endif()
if(BUILD_LIBRETRO_CORE)
if(NOT MSVC)
add_compile_options(-fPIC)
endif()
add_subdirectory(Source/ui_libretro)
endif()
endif(BUILD_PLAY)
if(BUILD_LIBRETRO_CORE)
add_subdirectory(Source/ui_libretro)
endif()
if(BUILD_TESTS)
enable_testing()

View File

@ -0,0 +1,29 @@
#!/usr/bin/env bash
if [ -z "$ANDROID_NDK" ]
then
echo "Please set ANDROID_NDK and run again"
exit -1
fi
STRIP="${ANDROID_NDK}/toolchains/llvm/prebuilt/*/bin/llvm-strip"
ABI_LIST="arm64-v8a armeabi-v7a x86 x86_64"
for ABI in $ABI_LIST
do
mkdir "build_$ABI"
pushd "build_$ABI"
cmake ../.. -DBUILD_LIBRETRO_CORE=yes -DBUILD_PLAY=off \
-GNinja \
-DANDROID_ABI="${ABI}" \
-DANDROID_NDK=${ANDROID_NDK} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \
-DANDROID_NATIVE_API_LEVEL=23 \
-DANDROID_TOOLCHAIN=clang
cmake --build . --target play_libretro
mv Source/ui_libretro/play_libretro.so ../play_libretro_${ABI}.so
${STRIP} -strip-all ../play_libretro_${ABI}.so ../play_libretro_${ABI}_stripped.so
popd
done