Skip to content

Update gitlab-ci #438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 61 additions & 57 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ include:
file: '/ios9.yml'

################################## CONSOLES ################################
# PlayStation2
- project: 'libretro-infrastructure/ci-templates'
file: '/ps2-static.yml'

# PlayStation3
- project: 'libretro-infrastructure/ci-templates'
file: '/psl1ght-static.yml'

# PlayStation Portable
- project: 'libretro-infrastructure/ci-templates'
file: '/psp-static.yml'
Expand All @@ -73,10 +81,6 @@ include:
- project: 'libretro-infrastructure/ci-templates'
file: '/vita-static.yml'

# PlayStation2
- project: 'libretro-infrastructure/ci-templates'
file: '/ps2-static.yml'

# Nintendo 3DS
- project: 'libretro-infrastructure/ci-templates'
file: '/ctr-static.yml'
Expand All @@ -101,7 +105,7 @@ include:
- project: 'libretro-infrastructure/ci-templates'
file: '/dingux-mips32.yml'

# OpenDingux
# OpenDingux (ARM)
- project: 'libretro-infrastructure/ci-templates'
file: '/dingux-arm32.yml'

Expand Down Expand Up @@ -138,22 +142,22 @@ libretro-build-windows-i686:
- .core-defs

# Windows msvc10 64-bit
#libretro-build-windows-msvc10-x64:
# extends:
# - .libretro-windows-x64-msvc10-msys2-make-default
# - .core-defs
libretro-build-windows-msvc10-x64:
extends:
- .libretro-windows-x64-msvc10-msys2-make-default
- .core-defs

# Windows msvc10 32-bit
#libretro-build-windows-msvc10-i686:
# extends:
# - .libretro-windows-i686-msvc10-msys2-make-default
# - .core-defs
libretro-build-windows-msvc10-i686:
extends:
- .libretro-windows-i686-msvc10-msys2-make-default
- .core-defs

# Windows msvc05 32-bit
#libretro-build-windows-msvc05-i686:
# extends:
# - .libretro-windows-i686-msvc05-msys2-make-default
# - .core-defs
libretro-build-windows-msvc05-i686:
extends:
- .libretro-windows-i686-msvc05-msys2-make-default
- .core-defs

# Linux 64-bit
libretro-build-linux-x64:
Expand All @@ -170,7 +174,7 @@ libretro-build-linux-i686:
# MacOS 64-bit
libretro-build-osx-x64:
extends:
- .libretro-osx-x64-make-default
- .libretro-osx-x64-make-10-7
- .core-defs

# MacOS ARM 64-bit
Expand Down Expand Up @@ -211,10 +215,10 @@ libretro-build-ios-arm64:
- .core-defs

# iOS (armv7) [iOS 9 and up]
#libretro-build-ios9:
# extends:
# - .libretro-ios9-make-default
# - .core-defs
libretro-build-ios9:
extends:
- .libretro-ios9-make-default
- .core-defs

# tvOS
libretro-build-tvos-arm64:
Expand All @@ -224,10 +228,10 @@ libretro-build-tvos-arm64:

################################### CONSOLES #################################
# PlayStation Portable
#libretro-build-psp:
# extends:
# - .libretro-psp-static-retroarch-master
# - .core-defs
libretro-build-psp:
extends:
- .libretro-psp-static-retroarch-master
- .core-defs

# PlayStation Vita
libretro-build-vita:
Expand All @@ -236,34 +240,40 @@ libretro-build-vita:
- .core-defs

# PlayStation2
#libretro-build-ps2:
# extends:
# - .libretro-ps2-static-retroarch-master
# - .core-defs
libretro-build-ps2:
extends:
- .libretro-ps2-static-retroarch-master
- .core-defs

# PlayStation3
libretro-build-psl1ght:
extends:
- .libretro-psl1ght-static-retroarch-master
- .core-defs

# Nintendo 3DS
#libretro-build-ctr:
# extends:
# - .libretro-ctr-static-retroarch-master
# - .core-defs
libretro-build-ctr:
extends:
- .libretro-ctr-static-retroarch-master
- .core-defs

# Nintendo GameCube
#libretro-build-ngc:
# extends:
# - .libretro-ngc-static-retroarch-master
# - .core-defs
libretro-build-ngc:
extends:
- .libretro-ngc-static-retroarch-master
- .core-defs

# Nintendo Wii
#libretro-build-wii:
# extends:
# - .libretro-wii-static-retroarch-master
# - .core-defs
libretro-build-wii:
extends:
- .libretro-wii-static-retroarch-master
- .core-defs

# Nintendo WiiU
#libretro-build-wiiu:
# extends:
# - .libretro-wiiu-static-retroarch-master
# - .core-defs
libretro-build-wiiu:
extends:
- .libretro-wiiu-static-retroarch-master
- .core-defs

# Nintendo Switch
libretro-build-libnx-aarch64:
Expand All @@ -272,21 +282,15 @@ libretro-build-libnx-aarch64:
- .core-defs

# OpenDingux
#libretro-build-dingux-mips32:
# extends:
# - .libretro-dingux-mips32-make-default
# - .core-defs

# OpenDingux Beta
libretro-build-dingux-odbeta-mips32:
libretro-build-dingux-mips32:
extends:
- .libretro-dingux-odbeta-mips32-make-default
- .libretro-dingux-mips32-make-default
- .core-defs

# OpenDingux Beta
libretro-build-rs90-odbeta-mips32:
libretro-build-dingux-odbeta-mips32:
extends:
- .libretro-rs90-odbeta-mips32-make-default
- .libretro-dingux-odbeta-mips32-make-default
- .core-defs

# RetroFW
Expand All @@ -295,7 +299,7 @@ libretro-build-retrofw-mips32:
- .libretro-retrofw-mips32-make-default
- .core-defs

# MIYOO
# Miyoo
libretro-build-miyoo-arm32:
extends:
- .libretro-miyoo-arm32-make-default
Expand Down
4 changes: 4 additions & 0 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ ifeq ($(platform), emscripten)
SOURCES_C += $(CORE_DIR)/vendor/libretro-common/rthreads/rthreads.c
endif

ifneq (,$(findstring msvc2003,$(platform)))
FLAGS += -I$(LIBRETRO_COMM_DIR)/include/compat/msvc
endif

# stb_vorbis
#SOURCES_C += $(CORE_DIR)/vendor/stb/stb_vorbis.c
FLAGS += -DHAVE_STB_VORBIS
Expand Down
73 changes: 62 additions & 11 deletions Makefile.libretro
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ else ifeq ($(platform), tvos-arm64)
TARGET := $(TARGET_NAME)_libretro_tvos.dylib
fpic := -fPIC
SHARED := -dynamiclib
CFLAGS += -DIOS -DCHAILOVE_DISABLE_LOVE_SYSTEM_EXECUTE
CXXFLAGS += -DCHAILOVE_DISABLE_LOVE_SYSTEM_EXECUTE
CFLAGS += -DIOS
ifeq ($(IOSSDK),)
IOSSDK := $(shell xcodebuild -version -sdk appletvos Path)
endif
Expand Down Expand Up @@ -216,6 +215,31 @@ else ifeq ($(platform), rpi2)
CFLAGS += -marm -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -funsafe-math-optimizations
CFLAGS += -fomit-frame-pointer -fstrict-aliasing -ffast-math

# Raspberry Pi 3
else ifeq ($(platform), rpi3)
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
SHARED := -shared -Wl,--version-script=link.T -Wl,-no-undefined
CFLAGS += -DARM
CFLAGS += -marm -mcpu=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard -funsafe-math-optimizations
CFLAGS += -fomit-frame-pointer -fstrict-aliasing -ffast-math

# Raspberry Pi 3 (64 bit)
else ifeq ($(platform), rpi3_64)
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
SHARED := -shared -Wl,--version-script=link.T -Wl,-no-undefined
CFLAGS += -mcpu=cortex-a53 -mtune=cortex-a53 -funsafe-math-optimizations
CFLAGS += -fomit-frame-pointer -fstrict-aliasing -ffast-math

# Raspberry Pi 4 (64-bit)
else ifneq (,$(findstring rpi4,$(platform)))
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
SHARED := -shared -Wl,--version-script=link.T -Wl,-no-undefined
CFLAGS += -mcpu=cortex-a72 -mtune=cortex-a72 -funsafe-math-optimizations
CFLAGS += -fomit-frame-pointer -fstrict-aliasing -ffast-math

# Lightweight PS3 Homebrew SDK
else ifeq ($(platform), psl1ght)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
Expand Down Expand Up @@ -299,26 +323,55 @@ else ifeq ($(platform), libnx)
else ifeq ($(platform), classic_armv7_a7)
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
SHARED := -shared -Wl,--version-script=link.T -Wl,-no-undefined
PLATFORM_DEFINES += -Ofast \
SHARED := -fPIC -shared -Wl,--version-script=link.T -Wl,-no-undefined
CFLAGS += -Ofast \
-flto=4 -fwhole-program -fuse-linker-plugin \
-fdata-sections -ffunction-sections -Wl,--gc-sections \
-fno-stack-protector -fno-ident -fomit-frame-pointer \
-falign-functions=1 -falign-jumps=1 -falign-loops=1 \
-fno-unwind-tables -fno-asynchronous-unwind-tables -fno-unroll-loops \
-fmerge-all-constants -fno-math-errno \
-marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
PLATFORM_DEFINES += -DARM
LDFLAGS += -marm -mtune=cortex-a7 -mfpu=neon-vfpv4
CXXFLAGS += $(CFLAGS)
CPPFLAGS += $(CFLAGS)
ASFLAGS += $(CFLAGS)
HAVE_NEON = 1
ARCH = arm
BUILTIN_GPU = neon
USE_DYNAREC = 1
ifeq ($(shell echo `$(CC) -dumpversion` "< 4.9" | bc -l), 1)
PLATFORM_DEFINES += -march=armv7-a
CFLAGS += -march=armv7-a
else
PLATFORM_DEFINES += -march=armv7ve
CFLAGS += -march=armv7ve
# If gcc is 5.0 or later
ifeq ($(shell echo `$(CC) -dumpversion` ">= 5" | bc -l), 1)
LDFLAGS += -static-libgcc -static-libstdc++
endif
endif

# (armv8 a35, hard point, neon based) ###
# Playstation Classic
else ifeq ($(platform), classic_armv8_a35)
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
SHARED := -shared -Wl,--version-script=link.T -Wl,-no-undefined
CFLAGS += -Ofast \
-flto=4 -fwhole-program -fuse-linker-plugin \
-fdata-sections -ffunction-sections -Wl,--gc-sections \
-fno-stack-protector -fno-ident -fomit-frame-pointer \
-falign-functions=1 -falign-jumps=1 -falign-loops=1 \
-fno-unwind-tables -fno-asynchronous-unwind-tables -fno-unroll-loops \
-fmerge-all-constants -fno-math-errno \
-marm -mtune=cortex-a35 -mfpu=neon-fp-armv8 -mfloat-abi=hard
CXXFLAGS += $(CFLAGS)
CPPFLAGS += $(CFLAGS)
ASFLAGS += $(CFLAGS)
HAVE_NEON = 1
ARCH = arm
BUILTIN_GPU = neon
USE_DYNAREC = 1
LDFLAGS += -lrt
LDFLAGS += -marm -mcpu=cortex-a35 -mfpu=neon-fp-armv8 -mfloat-abi=hard -Ofast -flto -fuse-linker-plugin
#######################################

# ARM
Expand Down Expand Up @@ -385,7 +438,7 @@ else ifeq ($(platform), retrofw)
PLATFORM_DEFINES += -DDINGUX_BETA=1
LIBS = -lm

# MIYOO
# Miyoo
else ifeq ($(platform), miyoo)
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
Expand Down Expand Up @@ -643,13 +696,11 @@ endif
ifeq ($(platform), ios-arm64)
LDFLAGS += -framework IOKit -framework Foundation
FLAGS += -D__MACH__ -D__APPLE__
FLAGS += -DCHAILOVE_DISABLE_LOVE_SYSTEM_EXECUTE
endif

ifeq ($(platform), tvos-arm64)
LDFLAGS += -framework Foundation
FLAGS += -D__MACH__ -D__APPLE__
FLAGS += -DCHAILOVE_DISABLE_LOVE_SYSTEM_EXECUTE
endif

ifeq ($(EXTERNAL_ZLIB), 1)
Expand Down
4 changes: 3 additions & 1 deletion src/love/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
#include "../ChaiLove.h"

#include <string>
#ifdef CHAILOVE_ENABLE_LOVE_SYSTEM_EXECUTE
#include <cstdlib>
#endif
#include <cstdio>
#include <vector>
#include "libretro.h"
Expand Down Expand Up @@ -107,7 +109,7 @@ std::string system::getUsername() {
}

bool system::execute(const std::string& command) {
#ifdef CHAILOVE_DISABLE_LOVE_SYSTEM_EXECUTE
#ifndef CHAILOVE_ENABLE_LOVE_SYSTEM_EXECUTE
pntr_app_log(PNTR_APP_LOG_ERROR, "[ChaiLove] [system] love.system.execute() is disabled");
return false;
#else
Expand Down
7 changes: 0 additions & 7 deletions test/unittests/system.chai
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ assert_equal(versionNumber[0], 2, "love.system.getVersion()")
var username = love.system.getUsername()
assert(true, "love.system.getUsername() == '" + username + "'")

// getOS()
if (love.system.getOS() == "Linux") {
// Run in foreground.
var result = love.system.execute("uname")
assert(result, "love.system.execute('uname')")
}

// setClipboardText()
love.system.setClipboardText("Hello World!")

Expand Down