Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
6fdf9c7
Add build-static stage
schellingb Jan 31, 2021
f50c621
Fix compiler setting for specific platforms
schellingb Jan 31, 2021
5ee4419
Disable failing console stages for now
schellingb Feb 1, 2021
2372e20
Switch Android NDK app platform from 23 to 16
schellingb Feb 13, 2021
7437b07
Resync
schellingb Feb 23, 2021
ef4331b
sync libretro-common updates
schellingb Mar 10, 2021
cc56814
Enable console platforms
schellingb Mar 10, 2021
5633a4b
Change language standard c++11 to gnu++11
schellingb Mar 10, 2021
a4cf929
Add nxmmap
schellingb Mar 10, 2021
ab2c592
Use retro_sleep from retro_timers.h
schellingb Mar 10, 2021
cb26ef9
Disable failing platforms
schellingb Mar 10, 2021
87864af
Fix include
schellingb Mar 10, 2021
79e606b
Compile fixes
schellingb Mar 10, 2021
eeb8425
Disable failing platform
schellingb Mar 10, 2021
6110754
Backport PRs:
inactive123 Mar 23, 2021
1b872b7
Backport PR #115 but do it a bit differently - adds ios9 target as well.
inactive123 Mar 23, 2021
b3f813b
Add osx-arm64 target
inactive123 Mar 23, 2021
770c8c6
Merge branch 'main' into new-targets
inactive123 Mar 23, 2021
f61f515
Disable dynarec for osx-arm64
inactive123 Mar 23, 2021
eb1e054
Add OpenDingux beta
inactive123 Mar 25, 2021
f14d458
Resync 0.12
schellingb Apr 21, 2021
a13085b
Resync 0.13
schellingb May 3, 2021
bea878f
Enable Haiku build
kwyxz May 13, 2021
553889d
Hopefully build 32bit
kwyxz May 13, 2021
d5e2203
Cosmetic
kwyxz May 13, 2021
066a339
Merge pull request #11 from kwyxz/main
inactive123 May 14, 2021
88a933f
Resync
schellingb May 20, 2021
800a385
Fix stack size of main emulation thread
schellingb May 20, 2021
88231a9
Vita port (#12)
isage May 21, 2021
db5367b
Enable Vita build stage
schellingb May 21, 2021
a3a4f14
Resync 0.14
schellingb Jul 25, 2021
48fe842
Fix stb_vorbis on static platform build
schellingb Jul 25, 2021
c994d19
Resync 0.15
schellingb Aug 14, 2021
abd96ad
Add support for new core options update display callback
schellingb Aug 18, 2021
1b07f98
Resync 0.16
schellingb Aug 29, 2021
4d70760
Resync 0.17
schellingb Sep 12, 2021
dcfd6a5
Resync 0.18
schellingb Oct 17, 2021
972a1a3
Resync 0.19
schellingb Oct 18, 2021
3d0266b
Resync 0.20
schellingb Oct 20, 2021
2cfb6c7
Resync 0.21
schellingb Dec 13, 2021
a96d413
Resync 0.22
schellingb Jan 5, 2022
94d0e6a
Resync 0.23
schellingb Jan 7, 2022
482122c
Resync 0.24
schellingb Jan 9, 2022
c1a0d6f
Resync 0.25
schellingb Jan 11, 2022
d22a43d
Resync 0.26
schellingb Jan 23, 2022
286871e
Resync 0.9.0
schellingb Apr 19, 2022
bb760cb
Resync 0.9.1
schellingb Apr 26, 2022
e0e22a0
Ensure built binaries are stripped
schellingb May 30, 2022
e704dca
Resync 0.9.2
schellingb May 30, 2022
0fc29c8
Resync 0.9.3
schellingb May 31, 2022
1d961fd
Resync 0.9.3
schellingb May 31, 2022
e7a3e60
Resync 0.9.5
schellingb Jun 22, 2022
b0bf5f2
Resync 0.9.6
schellingb Jun 25, 2022
2e1774e
Resync 0.9.7
schellingb Jul 6, 2022
4fdb557
Resync 0.9.7
schellingb Jul 6, 2022
98c7940
add emscripten platform to makefile
JoeOsborn Jan 25, 2023
2f964c4
add platform name
JoeOsborn Jan 25, 2023
7aa8466
remove pthreads from emscripten build
JoeOsborn Jan 25, 2023
822bd09
Add emscripten build to CI
JoeOsborn Jan 26, 2023
fe8e914
Force use of pthreads in emscripten builds
JoeOsborn Mar 13, 2023
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
128 changes: 99 additions & 29 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,38 +33,63 @@ include:
- project: 'libretro-infrastructure/ci-templates'
file: '/osx-x64.yml'

# MacOS ARM 64-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/osx-arm64.yml'

################################## CELLULAR ################################
# Android
- project: 'libretro-infrastructure/ci-templates'
file: '/android-jni.yml'

# ################################## CONSOLES ################################
# # Nintendo 3DS
# - project: 'libretro-infrastructure/ci-templates'
# file: '/ctr-static.yml'
#
# # Nintendo WiiU
# - project: 'libretro-infrastructure/ci-templates'
# file: '/wiiu-static.yml'
#
# # Nintendo Switch
# - project: 'libretro-infrastructure/ci-templates'
# file: '/libnx-static.yml'
#
# # PlayStation Vita
# - project: 'libretro-infrastructure/ci-templates'
# file: '/vita-static.yml'
# iOS
- project: 'libretro-infrastructure/ci-templates'
file: '/ios-arm64.yml'

# iOS (armv7)
- project: 'libretro-infrastructure/ci-templates'
file: '/ios9.yml'

################################## CONSOLES ################################
# Nintendo 3DS
- project: 'libretro-infrastructure/ci-templates'
file: '/ctr-static.yml'

# Nintendo WiiU
- project: 'libretro-infrastructure/ci-templates'
file: '/wiiu-static.yml'

# Nintendo Switch
- project: 'libretro-infrastructure/ci-templates'
file: '/libnx-static.yml'

# PlayStation Vita
- project: 'libretro-infrastructure/ci-templates'
file: '/vita-static.yml'

# OpenDingux
- project: 'libretro-infrastructure/ci-templates'
file: '/dingux-mips32.yml'

# tvOS (AppleTV)
- project: 'libretro-infrastructure/ci-templates'
file: '/tvos-arm64.yml'

################################## WEB ################################
# emscripten
- project: 'libretro-infrastructure/ci-templates'
file: '/emscripten-static.yml'

##############################################################################
#################################### STAGES ##################################
##############################################################################

# Stages for building
stages:
- build-prepare
- build-shared
# - build-static
- build-static

##############################################################################
#################################### STAGES ##################################
##############################################################################
#
################################### DESKTOPS #################################
# Windows 64-bit
libretro-build-windows-x64:
Expand Down Expand Up @@ -102,6 +127,14 @@ libretro-build-osx-x64:
variables:
ISMAC: 1

# MacOS ARM 64-bit
libretro-build-osx-arm64:
extends:
- .libretro-osx-arm64-make-default
- .core-defs
variables:
ISMAC: 1

################################### CELLULAR #################################
# Android ARMv7a
android-armeabi-v7a:
Expand All @@ -127,27 +160,64 @@ android-x86:
- .libretro-android-jni-x86
- .core-defs

# iOS
libretro-build-ios-arm64:
extends:
- .libretro-ios-arm64-make-default
- .core-defs

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

# tvOS
libretro-build-tvos-arm64:
extends:
- .libretro-tvos-arm64-make-default
- .core-defs

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

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

## Nintendo Switch
#libretro-build-libnx-aarch64:
# extends:
# - .libretro-libnx-static-retroarch-master
# - .core-defs
#
## PlayStation Vita
#libretro-build-vita:
# extends:
# - .libretro-vita-static-retroarch-master
# - .core-defs

# PlayStation Vita
libretro-build-vita:
extends:
- .libretro-vita-static-retroarch-master
- .core-defs

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

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

#################################### WEB #################################
# emscripten
libretro-build-emscripten:
extends:
- .libretro-emscripten-static-retroarch-master
- .core-defs
130 changes: 103 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2020-2021 Bernhard Schelling
# Copyright (C) 2020-2022 Bernhard Schelling
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -32,15 +32,60 @@ SOURCES := \
src/*/*.cpp \
src/*/*/*.cpp

CPUFLAGS :=
CPUFLAGS := $(MAKE_CPUFLAGS)
STRIPCMD := strip --strip-all
ifneq ($(ISWIN),)
OUTNAME := dosbox_pure_libretro.dll
CXX ?= g++
LDFLAGS := -Wl,--gc-sections -fno-ident
COMMONFLAGS += -pthread
else ifneq (,$(findstring ios,$(platform)))
ifeq ($(IOSSDK),)
IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path)
endif
OUTNAME := dosbox_pure_libretro_ios.dylib
MINVERSION :=
COMMONFLAGS += -DDISABLE_DYNAREC=1
ifeq ($(platform),ios-arm64)
CXX = c++ -arch arm64 -isysroot $(IOSSDK)
else
CXX = c++ -arch armv7 -isysroot $(IOSSDK)
endif
LDFLAGS := -Wl,-dead_strip
ifeq ($(platform),$(filter $(platform),ios9 ios-arm64))
MINVERSION = -miphoneos-version-min=8.0
else
MINVERSION = -miphoneos-version-min=5.0
endif
COMMONFLAGS += $(MINVERSION) -Wno-ignored-optimization-argument -Wno-unknown-warning-option
STRIPCMD := strip -xS
else ifeq ($(platform),tvos-arm64)
ifeq ($(IOSSDK),)
IOSSDK := $(shell xcodebuild -version -sdk appletvos Path)
endif
OUTNAME := dosbox_pure_libretro_tvos.dylib
CXX = c++ -arch arm64 -isysroot $(IOSSDK)
LDFLAGS := -Wl,-dead_strip
COMMONFLAGS += -DDISABLE_DYNAREC=1 -Wno-unknown-warning-option
STRIPCMD := strip -xS
else ifneq ($(ISMAC),)
OUTNAME := dosbox_pure_libretro.dylib
CXX ?= clang++
CXX ?= c++
LDFLAGS := -Wl,-dead_strip
COMMONFLAGS += -pthread -Wno-unknown-warning-option
ifeq ($(CROSS_COMPILE),1)
COMMONFLAGS += -DDISABLE_DYNAREC=1
TARGET_RULE = -target $(LIBRETRO_APPLE_PLATFORM) -isysroot $(LIBRETRO_APPLE_ISYSROOT)
COMMONFLAGS += $(TARGET_RULE)
LDFLAGS += $(TARGET_RULE)
endif
COMMONFLAGS += $(ARCHFLAGS)
LDFLAGS += $(ARCHFLAGS)
STRIPCMD := strip -xS
else ifeq ($(platform),windows) # For MSYS2 only
OUTNAME := dosbox_pure_libretro.dll
CXX ?= g++
LDFLAGS := -Wl,--gc-sections -fno-ident
else ifeq ($(platform),vita)
OUTNAME := dosbox_pure_libretro_vita.a
CXX := arm-vita-eabi-g++
Expand Down Expand Up @@ -70,14 +115,14 @@ else ifeq ($(platform),wii)
CXX := $(DEVKITPPC)/bin/powerpc-eabi-g++
AR := $(DEVKITPPC)/bin/powerpc-eabi-ar
COMMONFLAGS += -DGEKKO -mrvl -mcpu=750 -meabi -mhard-float -fpermissive
COMMONFLAGS += -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int -D__POWERPC__ -D__ppc__ -DMSB_FIRST -DWORDS_BIGENDIAN=1
COMMONFLAGS += -U__INT32_TYPE__ -U__UINT32_TYPE__ -D__INT32_TYPE__=int -D__POWERPC__ -D__ppc__ -DMSB_FIRST -DWORDS_BIGENDIAN=1
STATIC_LINKING = 1
else ifeq ($(platform),wiiu)
OUTNAME := dosbox_pure_libretro_wiiu.a
CXX := $(DEVKITPPC)/bin/powerpc-eabi-g++
AR := $(DEVKITPPC)/bin/powerpc-eabi-ar
COMMONFLAGS += -DGEKKO -DWIIU -DHW_RVL -mcpu=750 -meabi -mhard-float -I./deps/include/
COMMONFLAGS += -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int -D__POWERPC__ -D__ppc__ -DMSB_FIRST -DWORDS_BIGENDIAN=1
COMMONFLAGS += -DGEKKO -DWIIU -DHW_RVL -mcpu=750 -meabi -mhard-float
COMMONFLAGS += -U__INT32_TYPE__ -U__UINT32_TYPE__ -D__INT32_TYPE__=int -D__POWERPC__ -D__ppc__ -DMSB_FIRST -DWORDS_BIGENDIAN=1 -DGX_PTHREAD_LEGACY
STATIC_LINKING = 1
else ifeq ($(platform),libnx)
OUTNAME := dosbox_pure_libretro_libnx.a
Expand All @@ -86,30 +131,52 @@ else ifeq ($(platform),libnx)
COMMONFLAGS += -I$(LIBNX)/include/ -ftls-model=local-exec -specs=$(LIBNX)/switch.specs
COMMONFLAGS += $(INCLUDE) -D__SWITCH__ -DHAVE_LIBNX
STATIC_LINKING = 1
else ifeq ($(platform), gcw0)
else ifeq ($(platform),gcw0)
# You must used the toolchain built on or around 2014-08-20
OUTNAME := dosbox_pure_libretro.so
CXX := /opt/gcw0-toolchain/usr/bin/mipsel-linux-g++
LDFLAGS := -Wl,--gc-sections -fno-ident
CPUFLAGS := -ffast-math -march=mips32r2 -mtune=mips32r2 -mhard-float -fexpensive-optimizations -frename-registers
COMMONFLAGS += -pthread
STRIPCMD := /opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/bin/strip --strip-all
else ifneq ($(findstring Haiku,$(shell uname -s)),)
OUTNAME := dosbox_pure_libretro.so
LDFLAGS := -Wl,--gc-sections -fno-ident -lroot -lnetwork
ifneq ($(findstring BePC,$(shell uname -m)),)
CXX ?= g++-x86
else
CXX ?= g++
endif
else ifeq ($(platform), emscripten)
EXT?=bc
TARGET := $(TARGET_NAME)_libretro_$(platform).$(EXT)
STATIC_LINKING = 1
OUTNAME := dosbox_pure_libretro_emscripten.bc
COMMONFLAGS += -pthread
HAVE_THREADS = 1
else
OUTNAME := dosbox_pure_libretro.so
CXX ?= g++
LDFLAGS := -Wl,--gc-sections -fno-ident
# ARM optimizations
PROCCPU := $(shell cat /proc/cpuinfo))
ifneq ($(and $(filter ARMv7,$(PROCCPU)),$(filter neon,$(PROCCPU))),)
CPUFLAGS := -mcpu=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard -ffast-math
else
ifeq ($(CORTEX_A7), 1)
CPUFLAGS += -marm -mcpu=cortex-a7
ifeq ($(ARM_NEON), 1)
CPUFLAGS += -mfpu=neon-vfpv4
COMMONFLAGS += -pthread
ifeq ($(CPUFLAGS),)
# ARM optimizations
PROCCPU := $(shell cat /proc/cpuinfo))
ifneq ($(and $(filter ARMv7,$(PROCCPU)),$(filter neon,$(PROCCPU))),)
CPUFLAGS := -marm -mcpu=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard -ffast-math
else ifeq ($(ARM_RPI4), 1)
CPUFLAGS := -marm -mcpu=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard -ffast-math
else
ifeq ($(CORTEX_A7), 1)
CPUFLAGS += -marm -mcpu=cortex-a7
ifeq ($(ARM_NEON), 1)
CPUFLAGS += -mfpu=neon-vfpv4
endif
endif
ifeq ($(ARM_HARDFLOAT), 1)
CPUFLAGS += -mfloat-abi=hard
endif
endif
ifeq ($(ARM_HARDFLOAT), 1)
CPUFLAGS += -mfloat-abi=hard
endif
endif
CXX_VER := $(shell $(CXX) -v 2>&1)
ifneq ($(and $(findstring arm,$(CXX_VER)),$(findstring version 10,$(CXX_VER))),)
Expand Down Expand Up @@ -138,17 +205,28 @@ else ifeq ($(BUILD),ASAN)
else
BUILD := RELEASE
BUILDDIR := release
CFLAGS := -DNDEBUG -O2 -fno-ident
ifeq ($(platform),vita)
CFLAGS := -DNDEBUG -O3 -fno-ident -fno-partial-inlining
else
CFLAGS := -DNDEBUG -O2 -fno-ident
endif
LDFLAGS += -O2
endif

CFLAGS += $(CPUFLAGS) -std=c++11 -fpic -fomit-frame-pointer -fno-exceptions -fno-non-call-exceptions -Wno-address-of-packed-member -Wno-format -Wno-switch
CFLAGS += $(CPUFLAGS) -std=gnu++11 -fomit-frame-pointer -fexceptions -Wno-address-of-packed-member -Wno-format -Wno-switch -Wno-psabi
ifneq ($(STATIC_LINKING), 1)
CFLAGS += -fpic
else
CFLAGS += -DSTATIC_LINKING
endif

CFLAGS += -fvisibility=hidden -ffunction-sections
CFLAGS += -pthread -D__LIBRETRO__ -Iinclude
CFLAGS += -D__LIBRETRO__ -Iinclude -D_FILE_OFFSET_BITS=64
CFLAGS += $(COMMONFLAGS)
#CFLAGS += -fdata-sections #saves around 32 bytes on most platforms but wrongfully adds up to 60MB on msys2

LDFLAGS += $(CPUFLAGS) -lpthread -shared
LDLIBS := -lpthread
LDFLAGS += $(CPUFLAGS) -shared
#LDFLAGS += -static-libstdc++ -static-libgcc #adds 1MB to output and still dynamically links against libc and libm

.PHONY: all clean
Expand All @@ -173,11 +251,9 @@ ifeq ($(STATIC_LINKING), 1)
$(AR) rcs $@ $^
else
$(info Linking $@ ...)
$(CXX) $(LDFLAGS) -o $@ $^
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
ifneq ($(BUILD),DEBUG)
@-/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/bin/strip --strip-all $@ $(PIPETONULL);true # gcw0
@-strip --strip-all $@ $(PIPETONULL);true # others
@-strip -xS $@ $(PIPETONULL);true # mac
$(STRIPCMD) $@
endif
endif

Expand Down
Loading