Fix macOS compilation

Co-Authored-By: EmeraldLockdown <86802223+EmeraldLoc@users.noreply.github.com>
This commit is contained in:
Agent X 2024-07-02 14:26:00 -04:00
parent b4cd98da60
commit 0991503b6a
3 changed files with 19 additions and 7 deletions

View File

@ -668,7 +668,12 @@ ifeq ($(WINDOWS_BUILD),1) # fixes compilation in MXE on Linux and WSL
OBJCOPY := objcopy
OBJDUMP := $(CROSS)objdump
else ifeq ($(OSX_BUILD),1)
CPP := cpp-9 -P
OSX_GCC_VER = $(shell find `brew --prefix`/bin/gcc* | grep -oE '[[:digit:]]+' | sort -n | uniq | tail -1)
# if we couldn't find a gcc ver, default to 9
ifeq ($(OSX_GCC_VER),)
OSX_GCC_VER = 9
endif
CPP := cpp-$(OSX_GCC_VER) -P
OBJDUMP := i686-w64-mingw32-objdump
OBJCOPY := i686-w64-mingw32-objcopy
else ifeq ($(TARGET_N64),0) # Linux & other builds
@ -749,7 +754,7 @@ else ifeq ($(findstring SDL,$(WINDOW_API)),SDL)
BACKEND_LDFLAGS += -lGLESv2
else ifeq ($(OSX_BUILD),1)
BACKEND_LDFLAGS += -framework OpenGL `pkg-config --libs glew`
EXTRA_CPP_FLAGS += -stdlib=libc++ -std=c++0x
EXTRA_CPP_FLAGS += -stdlib=libc++ -std=c++17
else
BACKEND_LDFLAGS += -lGL
endif
@ -971,7 +976,9 @@ endif
# Prevent a crash with -sopt
export LANG := C
LDFLAGS += -latomic
ifeq ($(OSX_BUILD),0)
LDFLAGS += -latomic
endif
#==============================================================================#
# Extra CC Flags #

View File

@ -52,19 +52,22 @@ static void djui_panel_mod_menu_mod_inputbox(struct DjuiBase* caller) {
static void djui_panel_mod_menu_mod_create_element(struct DjuiBase* parent, int i) {
struct LuaHookedModMenuElement* hooked = &gHookedModMenuElements[i];
switch (hooked->element) {
case MOD_MENU_ELEMENT_BUTTON:
case MOD_MENU_ELEMENT_BUTTON: {
struct DjuiButton* button = djui_button_create(parent, hooked->name, DJUI_BUTTON_STYLE_NORMAL, djui_panel_mod_menu_mod_button);
button->base.tag = i;
break;
case MOD_MENU_ELEMENT_CHECKBOX:
}
case MOD_MENU_ELEMENT_CHECKBOX: {
struct DjuiCheckbox* checkbox = djui_checkbox_create(parent, hooked->name, &hooked->boolValue, djui_panel_mod_menu_mod_checkbox);
checkbox->base.tag = i;
break;
case MOD_MENU_ELEMENT_SLIDER:
}
case MOD_MENU_ELEMENT_SLIDER: {
struct DjuiSlider* slider = djui_slider_create(parent, hooked->name, &hooked->uintValue, hooked->sliderMin, hooked->sliderMax, djui_panel_mod_menu_mod_slider);
slider->base.tag = i;
break;
case MOD_MENU_ELEMENT_INPUTBOX:
}
case MOD_MENU_ELEMENT_INPUTBOX: {
struct DjuiRect* rect = djui_rect_container_create(parent, 32);
{
struct DjuiText* text1 = djui_text_create(&rect->base, hooked->name);
@ -83,6 +86,7 @@ static void djui_panel_mod_menu_mod_create_element(struct DjuiBase* parent, int
inputbox->base.tag = i;
}
break;
}
case MOD_MENU_ELEMENT_MAX:
}
}

View File

@ -2,6 +2,7 @@
#include <iostream>
#include <vector>
#include <filesystem>
#include <sstream>
#if defined(_WIN32) || defined(_WIN64)
#include <windows.h>