Cirrus CI update, Cocoa compilation fix (hopefully.)

This commit is contained in:
byuu 2019-08-01 03:15:52 +09:00
parent bc7456246c
commit 216b472418
4 changed files with 39 additions and 21 deletions

View File

@ -6,7 +6,7 @@ linux-x86_64-binaries_task:
- apt-get update && apt-get -y install build-essential libgtk2.0-dev libpulse-dev mesa-common-dev libgtksourceview2.0-dev libcairo2-dev libsdl2-dev libxv-dev libao-dev libopenal-dev libudev-dev zip - apt-get update && apt-get -y install build-essential libgtk2.0-dev libpulse-dev mesa-common-dev libgtksourceview2.0-dev libcairo2-dev libsdl2-dev libxv-dev libao-dev libopenal-dev libudev-dev zip
compile_script: compile_script:
- make -C bsnes - make -C bsnes local=false
package_script: package_script:
- mkdir bsnes-nightly - mkdir bsnes-nightly
@ -15,10 +15,11 @@ linux-x86_64-binaries_task:
- cp -a bsnes/out/bsnes bsnes-nightly/bsnes - cp -a bsnes/out/bsnes bsnes-nightly/bsnes
- cp -a bsnes/Database/* bsnes-nightly/Database - cp -a bsnes/Database/* bsnes-nightly/Database
- cp -a icarus/Database/* bsnes-nightly/Database - cp -a icarus/Database/* bsnes-nightly/Database
- cp -a GPLv3.txt bsnes-nightly/ - cp -a GPLv3.txt bsnes-nightly
- zip -r bsnes-nightly.zip bsnes-nightly
bsnes-nightly_artifacts: bsnes-nightly_artifacts:
path: "bsnes-nightly/**" path: "bsnes-nightly.zip"
freebsd-x86_64-binaries_task: freebsd-x86_64-binaries_task:
freebsd_instance: freebsd_instance:
@ -28,53 +29,56 @@ freebsd-x86_64-binaries_task:
- pkg install --yes gmake gdb gcc8 pkgconf sdl2 openal-soft gtksourceview2 libXv zip - pkg install --yes gmake gdb gcc8 pkgconf sdl2 openal-soft gtksourceview2 libXv zip
compile_script: compile_script:
- gmake -C bsnes - gmake -C bsnes local=false
package_script: package_script:
- mkdir bsnes-nightly - mkdir bsnes-nightly
- mkdir bsnes-nightly/Database - mkdir bsnes-nightly/Database
- mkdir bsnes-nightly/Firmware - mkdir bsnes-nightly/Firmware
- cp -a bsnes/out/bsnes bsnes-nightly/bsnes - cp -a bsnes/out/bsnes bsnes-nightly/bsnes
- cp -a bsnes/Database/* bsnes-nightly/Database/ - cp -a bsnes/Database/* bsnes-nightly/Database
- cp -a icarus/Database/* bsnes-nightly/Database/ - cp -a icarus/Database/* bsnes-nightly/Database
- cp -a GPLv3.txt bsnes-nightly/ - cp -a GPLv3.txt bsnes-nightly
- zip -r bsnes-nightly.zip bsnes-nightly
bsnes-nightly_artifacts: bsnes-nightly_artifacts:
path: "bsnes-nightly/**" path: "bsnes-nightly.zip"
windows-x86_64-binaries_task: windows-x86_64-binaries_task:
container: container:
image: ubuntu:latest image: ubuntu:latest
setup_script: setup_script:
- apt-get update && apt-get -y install build-essential mingw-w64 - apt-get update && apt-get -y install build-essential mingw-w64 zip
compile_script: compile_script:
- make -C bsnes platform=windows compiler="x86_64-w64-mingw32-g++" windres="x86_64-w64-mingw32-windres" - make -C bsnes local=false platform=windows compiler="x86_64-w64-mingw32-g++" windres="x86_64-w64-mingw32-windres"
package_script: package_script:
- mkdir bsnes-nightly - mkdir bsnes-nightly
- mkdir bsnes-nightly/Database - mkdir bsnes-nightly/Database
- mkdir bsnes-nightly/Firmware - mkdir bsnes-nightly/Firmware
- cp -a bsnes/out/bsnes bsnes-nightly/bsnes.exe - cp -a bsnes/out/bsnes bsnes-nightly/bsnes.exe
- cp -a bsnes/Database/* bsnes-nightly/Database/ - cp -a bsnes/Database/* bsnes-nightly/Database
- cp -a icarus/Database/* bsnes-nightly/Database/ - cp -a icarus/Database/* bsnes-nightly/Database
- cp -a GPLv3.txt bsnes-nightly/ - cp -a GPLv3.txt bsnes-nightly
- zip -r bsnes-nightly.zip bsnes-nightly
bsnes-nightly_artifacts: bsnes-nightly_artifacts:
path: "bsnes-nightly/**" path: "bsnes-nightly.zip"
macOS-x86_64-binaries_task: macOS-x86_64-binaries_task:
osx_instance: osx_instance:
image: mojave-base image: mojave-base
compile_script: compile_script:
- make -C bsnes - make -C bsnes local=false
package_script: package_script:
- mkdir bsnes-nightly - mkdir bsnes-nightly
- cp -a bsnes/out/bsnes.app bsnes-nightly/ - cp -a bsnes/out/bsnes.app bsnes-nightly
- cp -a GPLv3.txt bsnes-nightly/ - cp -a GPLv3.txt bsnes-nightly
- zip -r bsnes-nightly.zip bsnes-nightly
bsnes-nightly_artifacts: bsnes-nightly_artifacts:
path: "bsnes-nightly/**" path: "bsnes-nightly.zip"

View File

@ -2,6 +2,7 @@ target := bsnes
binary := application binary := application
build := performance build := performance
openmp := true openmp := true
local := true
flags += -I. -I.. flags += -I. -I..
# in order for this to work, obj/lzma.o must be omitted or bsnes will hang on startup. # in order for this to work, obj/lzma.o must be omitted or bsnes will hang on startup.
@ -11,6 +12,11 @@ ifeq ($(profile),true)
options += -pg options += -pg
endif endif
# binaries built with this flag are faster, but are not portable to multiple machines.
ifeq ($(local),true)
flags += -march=native
endif
nall.path := ../nall nall.path := ../nall
include $(nall.path)/GNUmakefile include $(nall.path)/GNUmakefile
@ -30,7 +36,6 @@ else ifeq ($(platform),macos)
endif endif
else ifneq ($(filter $(platform),linux bsd),) else ifneq ($(filter $(platform),linux bsd),)
ifeq ($(binary),application) ifeq ($(binary),application)
flags += -march=native
options += -Wl,-export-dynamic options += -Wl,-export-dynamic
options += -lX11 -lXext options += -lX11 -lXext
else ifeq ($(binary),library) else ifeq ($(binary),library)

View File

@ -5,7 +5,7 @@
-(id) initWith:(hiro::mTableView&)tableViewReference { -(id) initWith:(hiro::mTableView&)tableViewReference {
if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) { if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) {
tableView = &tableViewReference; tableView = &tableViewReference;
content = [[CocoaTableViewContent alloc] initWithFrame:NSMakeRect(0, 0, 0, 0)]; content = [[CocoaTableViewContent alloc] initWith:tableViewReference];
[self setDocumentView:content]; [self setDocumentView:content];
[self setBorderType:NSBezelBorder]; [self setBorderType:NSBezelBorder];
@ -126,6 +126,13 @@
@implementation CocoaTableViewContent : NSTableView @implementation CocoaTableViewContent : NSTableView
-(id) initWith:(hiro::mTableView&)tableViewReference {
if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) {
tableView = &tableViewReference;
}
return self;
}
-(void) keyDown:(NSEvent*)event { -(void) keyDown:(NSEvent*)event {
auto character = [[event characters] characterAtIndex:0]; auto character = [[event characters] characterAtIndex:0];
if(character == NSEnterCharacter || character == NSCarriageReturnCharacter) { if(character == NSEnterCharacter || character == NSCarriageReturnCharacter) {

View File

@ -8,7 +8,7 @@
CocoaTableViewContent* content; CocoaTableViewContent* content;
NSFont* font; NSFont* font;
} }
-(id) initWith:(hiro::mTableView&)tableView; -(id) initWith:(hiro::mTableView&)tableViewReference;
-(void) dealloc; -(void) dealloc;
-(CocoaTableViewContent*) content; -(CocoaTableViewContent*) content;
-(NSFont*) font; -(NSFont*) font;
@ -24,7 +24,9 @@
@end @end
@interface CocoaTableViewContent : NSTableView { @interface CocoaTableViewContent : NSTableView {
hiro::mTableView* tableView;
} }
-(id) initWith:(hiro::mTableView&)tableViewReference;
-(void) keyDown:(NSEvent*)event; -(void) keyDown:(NSEvent*)event;
@end @end