mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-10 20:08:31 +01:00
support building cimgui on osx
This commit is contained in:
36
cimgui/Makefile
Normal file
36
cimgui/Makefile
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#
|
||||||
|
# Cross Platform Makefile
|
||||||
|
# Compatible with Ubuntu 14.04.1 and Mac OS X
|
||||||
|
|
||||||
|
OBJS = cimgui.o
|
||||||
|
OBJS += ../imgui/imgui.o
|
||||||
|
|
||||||
|
UNAME_S := $(shell uname -s)
|
||||||
|
|
||||||
|
ifeq ($(UNAME_S), Linux) #LINUX
|
||||||
|
ECHO_MESSAGE = "Linux"
|
||||||
|
|
||||||
|
CXXFLAGS = -I../../ `pkg-config --cflags glfw3`
|
||||||
|
CXXFLAGS += -Wall
|
||||||
|
CFLAGS = $(CXXFLAGS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(UNAME_S), Darwin) #APPLE
|
||||||
|
ECHO_MESSAGE = "Mac OS X"
|
||||||
|
|
||||||
|
CXXFLAGS = -I/usr/local/include
|
||||||
|
CXXFLAGS += -Wall
|
||||||
|
CFLAGS = $(CXXFLAGS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
.cpp.o:
|
||||||
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
all:imgui_example
|
||||||
|
@echo Build complete for $(ECHO_MESSAGE)
|
||||||
|
|
||||||
|
imgui_example:$(OBJS)
|
||||||
|
$(CXX) -dynamiclib -current_version 1.0 -o cimgui.dylib $(OBJS) $(CXXFLAGS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm $(OBJS)
|
@@ -1,7 +1,11 @@
|
|||||||
|
|
||||||
#include "../imgui/imgui.h"
|
#include "../imgui/imgui.h"
|
||||||
|
|
||||||
|
#if defined _WIN32 || defined __CYGWIN__
|
||||||
#define API __declspec(dllexport)
|
#define API __declspec(dllexport)
|
||||||
|
#else
|
||||||
|
#define API
|
||||||
|
#endif
|
||||||
|
|
||||||
extern "C" API ImGuiIO* ImGui_GetIO()
|
extern "C" API ImGuiIO* ImGui_GetIO()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user