(Libretro/Gitlab) Add osx x64 target

This commit is contained in:
twinaphex 2021-03-26 18:06:36 +01:00
parent de7f485b9e
commit 35e743c685
3 changed files with 96 additions and 48 deletions

View File

@ -13,11 +13,11 @@ variables:
CORENAME: ppsspp CORENAME: ppsspp
CORE_ARGS: -DLIBRETRO=ON CORE_ARGS: -DLIBRETRO=ON
.linux-defs: .cmake-defs:
variables: variables:
EXTRA_PATH: lib EXTRA_PATH: lib
.windows-defs: .make-defs:
variables: variables:
MAKEFILE_PATH: libretro MAKEFILE_PATH: libretro
@ -40,9 +40,9 @@ include:
# Android # Android
- project: 'libretro-infrastructure/ci-templates' - project: 'libretro-infrastructure/ci-templates'
file: '/android-cmake.yml' file: '/android-cmake.yml'
################################## CONSOLES ################################
################################## CONSOLES ################################
#################################### MISC ################################## #################################### MISC ##################################
# Stages for building # Stages for building
@ -55,33 +55,40 @@ stages:
############################################################################## ##############################################################################
# #
################################### DESKTOPS ################################# ################################### DESKTOPS #################################
# Linux 64-bit
libretro-build-linux-x64:
extends:
- .libretro-linux-cmake-x86_64
- .core-defs
- .linux-defs
# Linux 32-bit
libretro-build-linux-i686:
extends:
- .libretro-linux-cmake-x86
- .core-defs
- .linux-defs
# Windows 64-bit # Windows 64-bit
libretro-build-windows-x64: libretro-build-windows-x64:
extends: extends:
- .libretro-windows-x64-msvc19-msys2-make-default - .libretro-windows-x64-msvc19-msys2-make-default
- .core-defs - .core-defs
- .windows-defs - .make-defs
# Windows 32-bit # Windows 32-bit
libretro-build-windows-i686: libretro-build-windows-i686:
extends: extends:
- .libretro-windows-i686-msvc19-msys2-make-default - .libretro-windows-i686-msvc19-msys2-make-default
- .core-defs - .core-defs
- .windows-defs - .make-defs
# Linux 64-bit
libretro-build-linux-x64:
extends:
- .libretro-linux-cmake-x86_64
- .core-defs
- .cmake-defs
# Linux 32-bit
libretro-build-linux-i686:
extends:
- .libretro-linux-cmake-x86
- .core-defs
- .cmake-defs
# MacOS 64-bit
libretro-build-osx-x64:
extends:
- .libretro-osx-x64-make-default
- .core-defs
- .make-defs
################################### CELLULAR ################################# ################################### CELLULAR #################################
# Android ARMv7a # Android ARMv7a

View File

@ -6,6 +6,8 @@ INCFLAGS := -I.
COREFLAGS := COREFLAGS :=
CPUFLAGS := CPUFLAGS :=
PLATOFRM_EXT :=
UNAME=$(shell uname -a) UNAME=$(shell uname -a)
# Cross compile ? # Cross compile ?
@ -70,7 +72,7 @@ ifneq (,$(findstring unix,$(platform)))
else else
GL_LIB := -lGL GL_LIB := -lGL
endif endif
PLATFORM_EXT := unix PLATFORM_EXT = unix
LDFLAGS += -lrt -ldl LDFLAGS += -lrt -ldl
# Raspberry Pi # Raspberry Pi
@ -82,7 +84,7 @@ else ifneq (,$(findstring rpi,$(platform)))
GL_LIB := -lGLESv2 GL_LIB := -lGLESv2
INCFLAGS += -I/opt/vc/include INCFLAGS += -I/opt/vc/include
CPUFLAGS += -DARMv5_ONLY CPUFLAGS += -DARMv5_ONLY
PLATFORM_EXT := unix PLATFORM_EXT = unix
TARGET_ARCH = arm TARGET_ARCH = arm
LDFLAGS += -lrt -ldl LDFLAGS += -lrt -ldl
@ -106,7 +108,7 @@ else ifneq (,$(findstring arm64,$(platform)))
endif endif
CPUFLAGS += -D__arm64__ -DARM64_ASM -D__NEON_OPT CPUFLAGS += -D__arm64__ -DARM64_ASM -D__NEON_OPT
LDFLAGS += -lrt -ldl LDFLAGS += -lrt -ldl
PLATFORM_EXT := unix PLATFORM_EXT = unix
# i.MX6 # i.MX6
else ifneq (,$(findstring imx6,$(platform))) else ifneq (,$(findstring imx6,$(platform)))
@ -116,7 +118,7 @@ else ifneq (,$(findstring imx6,$(platform)))
GLES = 1 GLES = 1
GL_LIB := -lGLESv2 GL_LIB := -lGLESv2
CPUFLAGS += CPUFLAGS +=
PLATFORM_EXT := unix PLATFORM_EXT = unix
TARGET_ARCH = arm TARGET_ARCH = arm
HAVE_NEON=1 HAVE_NEON=1
FFMPEGINCFLAGS += -I$(FFMPEGDIR)/linux/$(TARGET_ARCH)/include FFMPEGINCFLAGS += -I$(FFMPEGDIR)/linux/$(TARGET_ARCH)/include
@ -127,21 +129,32 @@ else ifneq (,$(findstring imx6,$(platform)))
# OS X # OS X
else ifneq (,$(findstring osx,$(platform))) else ifneq (,$(findstring osx,$(platform)))
TARGET := $(TARGET_NAME)_libretro.dylib TARGET := $(TARGET_NAME)_libretro.dylib
MINVERSION :=
LDFLAGS += -dynamiclib LDFLAGS += -dynamiclib
OSXVER = `sw_vers -productVersion | cut -d. -f 2` OSXVER = `sw_vers -productVersion | cut -d. -f 2`
OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9 )) && echo "YES"` OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9 )) && echo "YES"`
ifeq ($(OSX_LT_MAVERICKS),"YES") ifeq ($(OSX_LT_MAVERICKS),"YES")
LDFLAGS += -mmacosx-version-min=10.5 MINVERSION += -mmacosx-version-min=10.5
endif endif
LDFLAGS += -stdlib=libc++ LDFLAGS += $(MINVERSION)
LDFLAGS += -stdlib=libc++
fpic = -fPIC fpic = -fPIC
FFMPEGINCFLAGS += -I$(FFMPEGDIR)/macosx/$(TARGET_ARCH)/include FFMPEGINCFLAGS += -I$(FFMPEGDIR)/macosx/universal/include
FFMPEGLIBDIR := $(FFMPEGDIR)/macosx/$(TARGET_ARCH)/lib FFMPEGLIBDIR := $(FFMPEGDIR)/macosx/universal/lib
FFMPEGLDFLAGS += -liconv -L$(FFMPEGLIBDIR) -lavformat -lavcodec -lavutil -lswresample -lswscale FFMPEGLDFLAGS += -liconv -L$(FFMPEGLIBDIR) -lavformat -lavcodec -lavutil -lswresample -lswscale
PLATCFLAGS += -D__MACOSX__ PLATCFLAGS += -D__MACOSX__
GL_LIB := -framework OpenGL GL_LIB := -framework OpenGL
PLATFORM_EXT := darwin PLATFORM_EXT = darwin
ifeq ($(CROSS_COMPILE),1)
TARGET_RULE = -target $(LIBRETRO_APPLE_PLATFORM) -isysroot $(LIBRETRO_APPLE_ISYSROOT)
PLATCFLAGS += $(TARGET_RULE)
LDFLAGS += $(TARGET_RULE)
endif
PLATCFLAGS += $(ARCHFLAGS)
LDFLAGS += $(ARCHFLAGS)
# iOS # iOS
else ifneq (,$(findstring ios,$(platform))) else ifneq (,$(findstring ios,$(platform)))
@ -150,6 +163,7 @@ else ifneq (,$(findstring ios,$(platform)))
fpic = -fPIC fpic = -fPIC
GLES = 1 GLES = 1
GL_LIB := -framework OpenGLES GL_LIB := -framework OpenGLES
MINVERSION :=
HAVE_NEON = 1 HAVE_NEON = 1
FFMPEGINCFLAGS += -I$(FFMPEGDIR)/ios/universal/include FFMPEGINCFLAGS += -I$(FFMPEGDIR)/ios/universal/include
@ -160,18 +174,49 @@ else ifneq (,$(findstring ios,$(platform)))
IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path) IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path)
endif endif
ifeq ($(platform),ios-arm64)
CC = clang -arch arm64 -isysroot $(IOSSDK)
CXX = clang++ -arch arm64 -isysroot $(IOSSDK)
else
CC = clang -arch armv7 -isysroot $(IOSSDK) CC = clang -arch armv7 -isysroot $(IOSSDK)
CXX = clang++ -arch armv7 -isysroot $(IOSSDK) CXX = clang++ -arch armv7 -isysroot $(IOSSDK)
endif
OSXVER = `sw_vers -productVersion | cut -c 4` OSXVER = `sw_vers -productVersion | cut -c 4`
ifneq ($(OSXVER),9) ifneq ($(OSXVER),9)
CC += -miphoneos-version-min=5.0 MINVERSION = -miphoneos-version-min=5.0
AS += -miphoneos-version-min=5.0 else
CXX += -miphoneos-version-min=5.0 MINVERSION = -miphoneos-version-min=8.0
PLATCFLAGS += -miphoneos-version-min=5.0 endif
endif PLATCFLAGS += $(MINVERSION)
PLATCFLAGS += -DHAVE_POSIX_MEMALIGN PLATCFLAGS += -DHAVE_POSIX_MEMALIGN
CPUFLAGS += -DARMv5_ONLY -DARM CPUFLAGS += -DARMv5_ONLY -DARM
PLATFORM_EXT := unix PLATFORM_EXT = darwin
TARGET_ARCH = arm
else ifeq ($(platform), tvos-arm64)
TARGET := $(TARGET_NAME)_libretro_tvos.dylib
LDFLAGS += -dynamiclib -marm
fpic = -fPIC
GLES = 1
GL_LIB := -framework OpenGLES
MINVERSION :=
HAVE_NEON = 1
FFMPEGINCFLAGS += -I$(FFMPEGDIR)/ios/universal/include
FFMPEGLIBDIR := $(FFMPEGDIR)/ios/universal/lib
FFMPEGLDFLAGS += -L$(FFMPEGLIBDIR) -lavformat -lavcodec -lavutil -lswresample -lswscale
ifeq ($(IOSSDK),)
IOSSDK := $(shell xcodebuild -version -sdk appletvos Path)
endif
CC = clang -arch arm64 -isysroot $(IOSSDK)
CXX = clang++ -arch arm64 -isysroot $(IOSSDK)
OSXVER = `sw_vers -productVersion | cut -c 4`
PLATCFLAGS += $(MINVERSION)
PLATCFLAGS += -DHAVE_POSIX_MEMALIGN
CPUFLAGS += -DARMv5_ONLY -DARM
PLATFORM_EXT = darwin
TARGET_ARCH = arm TARGET_ARCH = arm
# Android # Android
@ -196,7 +241,7 @@ else ifneq (,$(findstring android,$(platform)))
FFMPEGLIBDIR := $(FFMPEGDIR)/android/armv7/lib FFMPEGLIBDIR := $(FFMPEGDIR)/android/armv7/lib
FFMPEGLDFLAGS += -L$(FFMPEGLIBDIR) -lavformat -lavcodec -lavutil -lswresample -lswscale FFMPEGLDFLAGS += -L$(FFMPEGLIBDIR) -lavformat -lavcodec -lavutil -lswresample -lswscale
PLATFORM_EXT := android PLATFORM_EXT = android
# QNX # QNX
else ifeq ($(platform), qnx) else ifeq ($(platform), qnx)
@ -216,7 +261,7 @@ else ifeq ($(platform), qnx)
CPUFLAGS += -marm -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp -D__arm__ -DARM_ASM -D__NEON_OPT CPUFLAGS += -marm -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp -D__arm__ -DARM_ASM -D__NEON_OPT
CFLAGS += -D__QNX__ CFLAGS += -D__QNX__
PLATFORM_EXT := unix PLATFORM_EXT = unix
# ARM # ARM
else ifneq (,$(findstring armv,$(platform))) else ifneq (,$(findstring armv,$(platform)))
@ -264,7 +309,7 @@ else ifeq ($(platform), emscripten)
-Daudio_convert_s16_to_float_C=mupen_audio_convert_s16_to_float_C -Daudio_convert_float_to_s16_C=mupen_audio_convert_float_to_s16_C \ -Daudio_convert_s16_to_float_C=mupen_audio_convert_s16_to_float_C -Daudio_convert_float_to_s16_C=mupen_audio_convert_float_to_s16_C \
-Daudio_convert_init_simd=mupen_audio_convert_init_simd -Drglgen_resolve_symbols_custom=mupen_rglgen_resolve_symbols_custom \ -Daudio_convert_init_simd=mupen_audio_convert_init_simd -Drglgen_resolve_symbols_custom=mupen_rglgen_resolve_symbols_custom \
-Drglgen_resolve_symbols=mupen_rglgen_resolve_symbols -Drglgen_resolve_symbols=mupen_rglgen_resolve_symbols
PLATFORM_EXT := unix PLATFORM_EXT = unix
# Windows MSVC 2017 all architectures # Windows MSVC 2017 all architectures
else ifneq (,$(findstring windows_msvc2017,$(platform))) else ifneq (,$(findstring windows_msvc2017,$(platform)))
@ -370,7 +415,7 @@ else ifneq (,$(findstring windows_msvc2017,$(platform)))
TARGET := $(TARGET_NAME)_libretro.dll TARGET := $(TARGET_NAME)_libretro.dll
PSS_STYLE :=2 PSS_STYLE :=2
LDFLAGS += -DLL LDFLAGS += -DLL
PLATFORM_EXT := win32 PLATFORM_EXT = win32
FFMPEGINCFLAGS += -I$(FFMPEGDIR)/Windows/$(TARGET_ARCH)/include FFMPEGINCFLAGS += -I$(FFMPEGDIR)/Windows/$(TARGET_ARCH)/include
FFMPEGLIBDIR := $(FFMPEGDIR)/Windows/$(TARGET_ARCH)/lib FFMPEGLIBDIR := $(FFMPEGDIR)/Windows/$(TARGET_ARCH)/lib
FFMPEGLDFLAGS += -LIBPATH:$(FFMPEGLIBDIR) FFMPEGLDFLAGS += -LIBPATH:$(FFMPEGLIBDIR)
@ -481,7 +526,7 @@ else ifneq (,$(findstring windows_msvc2019,$(platform)))
TARGET := $(TARGET_NAME)_libretro.dll TARGET := $(TARGET_NAME)_libretro.dll
PSS_STYLE :=2 PSS_STYLE :=2
LDFLAGS += -DLL LDFLAGS += -DLL
PLATFORM_EXT := win32 PLATFORM_EXT = win32
FFMPEGINCFLAGS += -I$(FFMPEGDIR)/Windows/$(TARGET_ARCH)/include FFMPEGINCFLAGS += -I$(FFMPEGDIR)/Windows/$(TARGET_ARCH)/include
FFMPEGLIBDIR := $(FFMPEGDIR)/Windows/$(TARGET_ARCH)/lib FFMPEGLIBDIR := $(FFMPEGDIR)/Windows/$(TARGET_ARCH)/lib
FFMPEGLDFLAGS += -LIBPATH:$(FFMPEGLIBDIR) FFMPEGLDFLAGS += -LIBPATH:$(FFMPEGLIBDIR)
@ -495,7 +540,7 @@ else ifneq (,$(findstring win,$(platform)))
CXXFLAGS += -fpermissive -Wno-multichar -D_UNICODE -DUNICODE CXXFLAGS += -fpermissive -Wno-multichar -D_UNICODE -DUNICODE
LDFLAGS += -shared -Wl,--no-undefined -static-libgcc -static-libstdc++ -Wl,--version-script=link.T -lwinmm -lgdi32 -lwsock32 -lws2_32 -ld3d9 -ld3dx9 LDFLAGS += -shared -Wl,--no-undefined -static-libgcc -static-libstdc++ -Wl,--version-script=link.T -lwinmm -lgdi32 -lwsock32 -lws2_32 -ld3d9 -ld3dx9
GL_LIB := -lopengl32 GL_LIB := -lopengl32
PLATFORM_EXT := win32 PLATFORM_EXT = win32
FFMPEGINCFLAGS += -I$(FFMPEGDIR)/Windows/$(TARGET_ARCH)/include FFMPEGINCFLAGS += -I$(FFMPEGDIR)/Windows/$(TARGET_ARCH)/include
FFMPEGLDFLAGS += -lavformat -lavcodec -lavutil -lswresample -lswscale FFMPEGLDFLAGS += -lavformat -lavcodec -lavutil -lswresample -lswscale
INCFLAGS += -include $(CORE_DIR)/Windows/mingw_defines.h INCFLAGS += -include $(CORE_DIR)/Windows/mingw_defines.h

View File

@ -340,6 +340,7 @@ SOURCES_CXX += $(COMMONDIR)/MemArenaAndroid.cpp \
$(EXTDIR)/glslang/glslang/OSDependent/Unix/ossource.cpp \ $(EXTDIR)/glslang/glslang/OSDependent/Unix/ossource.cpp \
$(COMMONDIR)/Render/Text/draw_text_android.cpp $(COMMONDIR)/Render/Text/draw_text_android.cpp
else else
COREFLAGS += -DVK_USE_PLATFORM_XLIB_KHR
SOURCES_CXX += $(COMMONDIR)/MemArenaPosix.cpp \ SOURCES_CXX += $(COMMONDIR)/MemArenaPosix.cpp \
$(EXTDIR)/glslang/glslang/OSDependent/Unix/ossource.cpp $(EXTDIR)/glslang/glslang/OSDependent/Unix/ossource.cpp
endif endif
@ -585,7 +586,7 @@ ifeq ($(WITH_DYNAREC),1)
CPUFLAGS += -D_M_IX86_FP CPUFLAGS += -D_M_IX86_FP
else else
CPUFLAGS += -msse -msse2 CPUFLAGS += -msse -msse2
endif endif
ifeq ($(TARGET_ARCH),x86_64) ifeq ($(TARGET_ARCH),x86_64)
CPUFLAGS += -D_M_X64 -D_ARCH_64 CPUFLAGS += -D_M_X64 -D_ARCH_64
else else
@ -655,11 +656,6 @@ SOURCES_CXX += \
$(LIBRETRODIR)/LibretroVulkanContext.cpp \ $(LIBRETRODIR)/LibretroVulkanContext.cpp \
$(LIBRETRODIR)/libretro_vulkan.cpp $(LIBRETRODIR)/libretro_vulkan.cpp
ifneq ($(PLATFORM_EXT), darwin)
ifeq ($(PLATFORM_EXT), unix)
COREFLAGS += -DVK_USE_PLATFORM_XLIB_KHR
endif
endif
ifeq ($(PLATFORM_EXT), win32) ifeq ($(PLATFORM_EXT), win32)
SOURCES_CXX += \ SOURCES_CXX += \