Skip to content

Commit

Permalink
use gcc on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
burhanr13 committed Dec 5, 2024
1 parent b601ff8 commit b6757bb
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: brew install sdl2 glew xxhash xbyak capstone
run: brew install gcc sdl2 glew xxhash xbyak capstone
- name: build
run: make USER=1
- uses: actions/upload-artifact@v4
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ else
endif

ifeq ($(shell uname),Darwin)
CFLAGS += -arch x86_64
CPPFLAGS += -I/opt/homebrew/include
LDFLAGS := -L/usr/local/lib -L/opt/homebrew/lib $(LDFLAGS)
CC := gcc-14
CXX := g++-14
CPPFLAGS += -I/usr/local/include
LDFLAGS := -L/usr/local/lib $(LDFLAGS)
LDFLAGS += -framework OpenGL -lGLEW
else
LDFLAGS += -lGL -lGLEW
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You need the following dependencies installed to build and run:

They can all be installed with your local package manager (brew on macos, apt on ubuntu, etc).

To build use `make`. You can pass some options to make, `USER=1` to compile a user build with lto, and `DEBUG=1` for unoptimized build with debug symbols. I have tested on both Linux with gcc and MacOS with Apple clang. Currently Windows is not natively supported, but you should be able to use the emulator on Windows through WSL (Windows Subsystem for Linux).
To build use `make`. You can pass some options to make, `USER=1` to compile a user build with lto, and `DEBUG=1` for unoptimized build with debug symbols. gcc is necessary to compile on both Linux and MacOS. Currently Windows is not natively supported, but you should be able to use the emulator on Windows through WSL (Windows Subsystem for Linux).

Note for M1 Mac users: we currently only have x86 JIT backends, so you will need to install the x86 version of brew. A guide can be found [here](https://gist.github.com/progrium/b286cd8c82ce0825b2eb3b0b3a0720a0).

Expand Down
7 changes: 0 additions & 7 deletions src/pica/hostshaders/hostshaders.cpp

This file was deleted.

10 changes: 0 additions & 10 deletions src/pica/hostshaders/hostshaders.h

This file was deleted.

6 changes: 5 additions & 1 deletion src/pica/renderer_gl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
#include "../3ds.h"
#include "../emulator_state.h"
#include "gpu.h"
#include "hostshaders/hostshaders.h"

#include "hostshaders/main.frag"
#include "hostshaders/main.vert"
#include "hostshaders/gpu.frag"
#include "hostshaders/gpu.vert"

GLuint make_shader(const char* vert, const char* frag) {
GLuint vertexShader = glCreateShader(GL_VERTEX_SHADER);
Expand Down

0 comments on commit b6757bb

Please sign in to comment.