Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile changes to get macOS/clang builds working. #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ OBJ = obj
BIN = bin

CFLAGS = -Wall
CXXFLAGS = -std=c++17
LDFLAGS =

ifneq ($(RELEASE),1)
Expand All @@ -29,7 +30,7 @@ include libvgm.mak

$(OBJ)/%.o: $(SRC)/%.cpp
@mkdir -p $(@D)
$(CXX) $(CFLAGS) -MMD -c $< -o $@
$(CXX) $(CFLAGS) $(CXXFLAGS) -MMD -c $< -o $@

#======================================================================

Expand Down
6 changes: 3 additions & 3 deletions imgui.mak
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ endif
ifeq ($(UNAME_S), Darwin) #APPLE
ECHO_MESSAGE = "Mac OS X"
LDFLAGS_IMGUI += -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo
LDFLAGS_IMGUI += -L/usr/local/lib -L/opt/local/lib
LDFLAGS_IMGUI += -L/usr/local/lib
#LDFLAGS_IMGUI += -lglfw3
LDFLAGS_IMGUI += -lglfw

Expand Down Expand Up @@ -52,11 +52,11 @@ IMGUI_CTE_OBJS = \

$(IMGUI_CTE_OBJ)/%.o: $(IMGUI_CTE_SRC)/%.cpp
@mkdir -p $(@D)
$(CXX) $(CFLAGS) -MMD -c $< -o $@
$(CXX) $(CFLAGS) $(CXXFLAGS) -MMD -c $< -o $@

$(IMGUI_OBJ)/%.o: $(IMGUI_SRC)/%.cpp
@mkdir -p $(@D)
$(CXX) $(CFLAGS) -MMD -c $< -o $@
$(CXX) $(CFLAGS) $(CXXFLAGS) -MMD -c $< -o $@

$(IMGUI_OBJ)/%.o: $(IMGUI_SRC)/%.c
@mkdir -p $(@D)
Expand Down
4 changes: 2 additions & 2 deletions libvgm.mak
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ CFLAGS += -DAUDDRV_WINMM -DAUDDRV_DSOUND -DAUDDRV_XAUD2
LDFLAGS_LIBVGM += -Wl,-Bstatic -lvgm-audio -lvgm-emu -lvgm-utils -Wl,-Bdynamic
LDFLAGS_LIBVGM += -ldsound -luuid -lwinmm -lole32
else
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add an if case for Mac builds here. See imgui.mak

CFLAGS += `pkg-config --with-path=/usr/local/lib/pkgconfig --cflags vgm-audio`
LDFLAGS_LIBVGM += -Wl,-rpath,/usr/local/lib `pkg-config --with-path=/usr/local/lib/pkgconfig --libs vgm-audio vgm-emu`
CFLAGS += `pkg-config --cflags vgm-audio`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "--with-path" is a parameter which is only supported in "pkgconf", an alternate implementation of pkg-config that is used by Arch Linux. Ideally we'd be able autodetect which version/implementation of pkg-config that is used to decide whether this should be specified or not.

LDFLAGS_LIBVGM += -Wl,-rpath,/usr/local/lib `pkg-config --libs vgm-audio vgm-emu ao` -framework AudioToolbox
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will break other platforms since AudioToolBox is a Mac exclusive API.

endif