mirror of
https://github.com/Relintai/sfw.git
synced 2024-11-08 07:52:09 +01:00
OSX amalgamated build fix.
This commit is contained in:
parent
8d4acb7293
commit
c998970d73
@ -6,29 +6,42 @@
|
||||
|
||||
// On OSX you need to compile this file separately with an objective c compiler
|
||||
|
||||
#ifndef ONLY_GLAD
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
#ifndef _APPLE_NO_IMPL_
|
||||
|
||||
#ifndef SFW_3RD_IMPL
|
||||
#define SFW_3RD_IMPL
|
||||
#endif
|
||||
#endif //SFW_3RD_IMPL
|
||||
|
||||
#endif //_APPLE_NO_IMPL_
|
||||
|
||||
#endif //__APPLE__
|
||||
|
||||
#ifdef SFW_3RD_IMPL
|
||||
#define GLAD_GL_IMPLEMENTATION // glad
|
||||
#endif
|
||||
#endif //SFW_3RD_IMPL
|
||||
|
||||
#endif //ONLY_GLAD
|
||||
|
||||
{{FILE:sfw/render_core/3rd_glad.h}}
|
||||
|
||||
#ifndef ONLY_GLAD
|
||||
|
||||
#ifdef SFW_3RD_IMPL
|
||||
#define STB_TRUETYPE_IMPLEMENTATION
|
||||
#endif //SFW_3RD_IMPL
|
||||
|
||||
{{FILE:sfw/render_core/3rd_stb_truetype.h}}
|
||||
|
||||
#ifdef SFW_3RD_IMPL
|
||||
#define STB_IMAGE_IMPLEMENTATION // stbi
|
||||
#define STB_IMAGE_WRITE_IMPLEMENTATION // stbi_write
|
||||
#define STB_SPRINTF_IMPLEMENTATION // stb_sprintf
|
||||
#define STB_SPRINTF_NOUNALIGNED // stb_sprintf
|
||||
#endif //SFW_3RD_IMPL
|
||||
|
||||
{{FILE:sfw/render_core/3rd_stb_image.h}}
|
||||
|
||||
@ -37,6 +50,8 @@
|
||||
//---
|
||||
#undef freelist
|
||||
|
||||
#ifdef SFW_3RD_IMPL
|
||||
|
||||
#define _GLFW_IMPLEMENTATION // glfw337
|
||||
#define GLFW_INCLUDE_NONE // glfw337
|
||||
#ifdef __APPLE__
|
||||
@ -49,9 +64,12 @@
|
||||
|
||||
#undef _GNU_SOURCE
|
||||
|
||||
#endif //SFW_3RD_IMPL
|
||||
|
||||
{{FILE:sfw/render_core/3rd_glfw3.h}}
|
||||
|
||||
#undef timeGetTime
|
||||
#undef Time
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -17,7 +17,19 @@
|
||||
#include <memory.h>
|
||||
|
||||
#ifndef SFW_H
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifndef _APPLE_NO_IMPL_
|
||||
#define _APPLE_NO_IMPL_
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "sfw.h"
|
||||
|
||||
#undef ONLY_GLAD
|
||||
|
||||
#include "sfw_3rd.m"
|
||||
|
||||
#endif
|
||||
|
||||
// On OSX sfw_3rd.m has to be compiled manually on Objective C Mode.
|
||||
|
@ -818,6 +818,15 @@
|
||||
#endif
|
||||
|
||||
#ifndef GLAD_GL_H_
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifndef _APPLE_NO_IMPL_
|
||||
#define _APPLE_NO_IMPL_
|
||||
#endif //_APPLE_NO_IMPL_
|
||||
#endif //__APPLE__
|
||||
|
||||
#define ONLY_GLAD
|
||||
|
||||
#include "sfw_3rd.m"
|
||||
#endif
|
||||
#endif
|
||||
|
@ -1,12 +1,17 @@
|
||||
cp -u ../out/full/sfw.h sfw.h
|
||||
cp -u ../out/full/sfw.cpp sfw.cpp
|
||||
cp -u ../out/full/sfw_3rd.m sfw_3rd.m
|
||||
rm sfw.h
|
||||
rm sfw.cpp
|
||||
rm sfw_3rd.m
|
||||
|
||||
cp ../out/full/sfw.h sfw.h
|
||||
cp ../out/full/sfw.cpp sfw.cpp
|
||||
cp ../out/full/sfw_3rd.m sfw_3rd.m
|
||||
|
||||
export SDKROOT=$(xcrun --show-sdk-path)
|
||||
|
||||
export args="-std=c++14 -w -framework cocoa -framework iokit -framework CoreFoundation -framework CoreAudio -framework AudioToolbox "
|
||||
|
||||
clang++ $args -g -c sfw.cpp -o sfw.o
|
||||
|
||||
clang++ -w -framework cocoa -framework iokit -framework CoreFoundation -framework CoreAudio -framework AudioToolbox -g -c sfw_3rd.m -o sfw_3rd.o
|
||||
|
||||
clang++ $args -g -c game_scene.cpp -o game_scene.o
|
||||
|
Loading…
Reference in New Issue
Block a user