Skip to content

Commit 166dabd

Browse files
authored
Merge pull request #90 from Optiroc/osx-makefile
Minor tweaks for OSX build
2 parents e2c797f + 4f7b82a commit 166dabd

File tree

3 files changed

+55
-32
lines changed

3 files changed

+55
-32
lines changed

bsnes/Makefile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ifeq ($(DEBUG), 1)
2222
else
2323
flags += -O3 -fomit-frame-pointer
2424
ifeq ($(platform),osx)
25-
# -s is deprecated as of clang 7.0, and using it breaks linking for some reason
25+
# -s is deprecated as of Apple LLVM 7.0, and using it breaks linking with some versions
2626
else
2727
link += -s
2828
endif
@@ -81,7 +81,7 @@ ifeq ($(platform),osx)
8181
$(strip $(cpp) -o $(osxbundle)/Contents/MacOS/bsnes $(objects) $(link))
8282
mkdir -p $(osxbundle)/Contents/Resources
8383
cp -f data/bsnes.icns $(osxbundle)/Contents/Resources/AppIcon.icns
84-
cp -f data/Info.plist $(osxbundle)/Contents/Info.plist
84+
sed 's/@VERSION/$(version)/g' data/Info.plist > $(osxbundle)/Contents/Info.plist
8585
else
8686
$(strip $(cpp) -o out/bsnes $(objects) $(link))
8787
endif
@@ -112,14 +112,12 @@ endif
112112

113113
plugins: build
114114
@$(MAKE) -C ../snesreader
115-
ifneq ($(platform), osx)
116115
@$(MAKE) -C ../snesfilter
117-
endif
118116
@$(MAKE) -C ../supergameboy
119117
ifeq ($(platform),osx)
120118
mkdir -p $(osxbundle)/Contents/Frameworks
121119
cp -f ../snesreader/libsnesreader.dylib $(osxbundle)/Contents/Frameworks/libsnesreader.dylib
122-
# cp -f ../snesfilter/libsnesfilter.dylib $(osxbundle)/Contents/Frameworks/libsnesfilter.dylib
120+
cp -f ../snesfilter/libsnesfilter.dylib $(osxbundle)/Contents/Frameworks/libsnesfilter.dylib
123121
cp -f ../supergameboy/libsupergameboy.dylib $(osxbundle)/Contents/Frameworks/libsupergameboy.dylib
124122
endif
125123

@@ -129,10 +127,10 @@ ifeq ($(platform),osx)
129127
@zip -9 -r ../bsnes_$(version)_osx.zip $(osxbundle)
130128
@rm -rf $(osxbundle)
131129
else
132-
@echo Distribution building not available for current platform
130+
@echo Distribution target not available for current platform
133131
endif
134132

135-
clean: ui_clean
133+
clean: ui_clean plugins_clean
136134
-@$(call delete,obj/*.o)
137135
-@$(call delete,obj/*.a)
138136
-@$(call delete,obj/*.so)
@@ -148,6 +146,11 @@ ifeq ($(platform),osx)
148146
@rm -rf $(osxbundle)
149147
endif
150148

149+
plugins_clean:
150+
@$(MAKE) clean -C ../snesreader
151+
@$(MAKE) clean -C ../snesfilter
152+
@$(MAKE) clean -C ../supergameboy
153+
151154
archive-all:
152155
tar -cjf bsnes.tar.bz2 data launcher libco nall obj out phoenix ruby snes ui-phoenix ui-qt Makefile cc.bat clean.bat sync.sh
153156

bsnes/data/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>v073+3</string>
18+
<string>@VERSION</string>
1919
<key>CFBundleVersion</key>
20-
<string>v073+3</string>
20+
<string>@VERSION</string>
2121
<key>LSMinimumSystemVersion</key>
2222
<string>10.6</string>
2323
<key>NSPrincipalClass</key>

snesfilter/snesfilter.cpp

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <QtGui>
1515

1616
#include <nall/config.hpp>
17+
#include <nall/detect.hpp>
1718
#include <nall/platform.hpp>
1819
#include <nall/string.hpp>
1920
using namespace nall;
@@ -22,15 +23,21 @@ const uint32_t *colortable;
2223
configuration *config;
2324

2425
#include "direct/direct.cpp"
25-
#include "pixellate2x/pixellate2x.cpp"
26-
#include "scale2x/scale2x.cpp"
27-
#include "2xsai/2xsai.cpp"
28-
#include "lq2x/lq2x.cpp"
29-
#include "hq2x/hq2x.cpp"
3026
#include "ntsc/ntsc.cpp"
27+
#if !defined(PLATFORM_OSX)
28+
#include "pixellate2x/pixellate2x.cpp"
29+
#include "scale2x/scale2x.cpp"
30+
#include "2xsai/2xsai.cpp"
31+
#include "lq2x/lq2x.cpp"
32+
#include "hq2x/hq2x.cpp"
33+
#endif
3134

3235
bsnesexport const char* snesfilter_supported() {
33-
return "Pixellate2x;Scale2x;2xSaI;Super 2xSaI;Super Eagle;LQ2x;HQ2x;NTSC";
36+
#if defined(PLATFORM_OSX)
37+
return "NTSC";
38+
#else
39+
return "Pixellate2x;Scale2x;2xSaI;Super 2xSaI;Super Eagle;LQ2x;HQ2x;NTSC";
40+
#endif
3441
}
3542

3643
bsnesexport void snesfilter_configuration(configuration &config_) {
@@ -47,14 +54,18 @@ bsnesexport void snesfilter_colortable(const uint32_t *colortable_) {
4754
bsnesexport void snesfilter_size(unsigned filter, unsigned &outwidth, unsigned &outheight, unsigned width, unsigned height) {
4855
switch(filter) {
4956
default: return filter_direct.size(outwidth, outheight, width, height);
50-
case 1: return filter_pixellate2x.size(outwidth, outheight, width, height);
51-
case 2: return filter_scale2x.size(outwidth, outheight, width, height);
52-
case 3: return filter_2xsai.size(outwidth, outheight, width, height);
53-
case 4: return filter_super2xsai.size(outwidth, outheight, width, height);
54-
case 5: return filter_supereagle.size(outwidth, outheight, width, height);
55-
case 6: return filter_lq2x.size(outwidth, outheight, width, height);
56-
case 7: return filter_hq2x.size(outwidth, outheight, width, height);
57-
case 8: return filter_ntsc.size(outwidth, outheight, width, height);
57+
#if defined(PLATFORM_OSX)
58+
case 1: return filter_ntsc.size(outwidth, outheight, width, height);
59+
#else
60+
case 1: return filter_pixellate2x.size(outwidth, outheight, width, height);
61+
case 2: return filter_scale2x.size(outwidth, outheight, width, height);
62+
case 3: return filter_2xsai.size(outwidth, outheight, width, height);
63+
case 4: return filter_super2xsai.size(outwidth, outheight, width, height);
64+
case 5: return filter_supereagle.size(outwidth, outheight, width, height);
65+
case 6: return filter_lq2x.size(outwidth, outheight, width, height);
66+
case 7: return filter_hq2x.size(outwidth, outheight, width, height);
67+
case 8: return filter_ntsc.size(outwidth, outheight, width, height);
68+
#endif
5869
}
5970
}
6071

@@ -64,20 +75,29 @@ bsnesexport void snesfilter_render(
6475
) {
6576
switch(filter) {
6677
default: return filter_direct.render(output, outpitch, input, pitch, width, height);
67-
case 1: return filter_pixellate2x.render(output, outpitch, input, pitch, width, height);
68-
case 2: return filter_scale2x.render(output, outpitch, input, pitch, width, height);
69-
case 3: return filter_2xsai.render(output, outpitch, input, pitch, width, height);
70-
case 4: return filter_super2xsai.render(output, outpitch, input, pitch, width, height);
71-
case 5: return filter_supereagle.render(output, outpitch, input, pitch, width, height);
72-
case 6: return filter_lq2x.render(output, outpitch, input, pitch, width, height);
73-
case 7: return filter_hq2x.render(output, outpitch, input, pitch, width, height);
74-
case 8: return filter_ntsc.render(output, outpitch, input, pitch, width, height);
78+
#if defined(PLATFORM_OSX)
79+
case 1: return filter_ntsc.render(output, outpitch, input, pitch, width, height);
80+
#else
81+
case 1: return filter_pixellate2x.render(output, outpitch, input, pitch, width, height);
82+
case 2: return filter_scale2x.render(output, outpitch, input, pitch, width, height);
83+
case 3: return filter_2xsai.render(output, outpitch, input, pitch, width, height);
84+
case 4: return filter_super2xsai.render(output, outpitch, input, pitch, width, height);
85+
case 5: return filter_supereagle.render(output, outpitch, input, pitch, width, height);
86+
case 6: return filter_lq2x.render(output, outpitch, input, pitch, width, height);
87+
case 7: return filter_hq2x.render(output, outpitch, input, pitch, width, height);
88+
case 8: return filter_ntsc.render(output, outpitch, input, pitch, width, height);
89+
#endif
7590
}
7691
}
7792

7893
bsnesexport QWidget* snesfilter_settings(unsigned filter) {
7994
switch(filter) {
8095
default: return 0;
81-
case 8: return filter_ntsc.settings();
96+
#if defined(PLATFORM_OSX)
97+
case 1:
98+
#else
99+
case 8:
100+
#endif
101+
return filter_ntsc.settings();
82102
}
83103
}

0 commit comments

Comments
 (0)