More MacOS fixes and stuff
This commit is contained in:
parent
59fd8c4328
commit
617c296fe4
|
@ -3,3 +3,5 @@ cbt_impl.c
|
||||||
state
|
state
|
||||||
add-impl.py
|
add-impl.py
|
||||||
raylib
|
raylib
|
||||||
|
libraylib.*
|
||||||
|
extras
|
||||||
|
|
21
cbt.c
21
cbt.c
|
@ -2,6 +2,17 @@
|
||||||
#define CBT_IMPLEMENTATION
|
#define CBT_IMPLEMENTATION
|
||||||
#include "cbt.h"
|
#include "cbt.h"
|
||||||
|
|
||||||
|
bool compile_file(const char *input, const char *output) {
|
||||||
|
return cbt_proc_wait(cbt_proc_new(
|
||||||
|
CBT_PROC_AUTO, cbt_cc, input, "-o", output, "libraylib.a", "-lm",
|
||||||
|
"-lpthread",
|
||||||
|
#ifdef __APPLE__
|
||||||
|
"-framework", "CoreVideo", "-framework", "IOKit", "-framework",
|
||||||
|
"Cocoa", "-framework", "GLUT", "-framework", "OpenGL",
|
||||||
|
#endif
|
||||||
|
"-I./raylib/src")) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
CBT_INIT(argc, argv);
|
CBT_INIT(argc, argv);
|
||||||
|
|
||||||
|
@ -15,14 +26,18 @@ int main(int argc, char **argv) {
|
||||||
cbt_lib_cflags(&raylib, "-D_GNU_SOURCE", "-DPLATFORM_DESKTOP",
|
cbt_lib_cflags(&raylib, "-D_GNU_SOURCE", "-DPLATFORM_DESKTOP",
|
||||||
"-DGRAPHICS_API_OPENGL_33", "-Wno-missing-braces",
|
"-DGRAPHICS_API_OPENGL_33", "-Wno-missing-braces",
|
||||||
"-Werror=pointer-arith", "-fno-strict-aliasing", "-std=c99",
|
"-Werror=pointer-arith", "-fno-strict-aliasing", "-std=c99",
|
||||||
"-fPIC", "-O1", "-Werror=implicit-function-declaration",
|
#ifndef __APPLE__
|
||||||
|
"-fPIC",
|
||||||
|
#else
|
||||||
|
"-x", "objective-c",
|
||||||
|
#endif
|
||||||
|
"-O1", "-Werror=implicit-function-declaration",
|
||||||
"-I./raylib/src", "-I./raylib/src/external/glfw/include",
|
"-I./raylib/src", "-I./raylib/src/external/glfw/include",
|
||||||
"-I./raylib/src/external/glfw/deps/mingw");
|
"-I./raylib/src/external/glfw/deps/mingw");
|
||||||
cbt_lib_build(raylib, NULL);
|
cbt_lib_build(raylib, NULL);
|
||||||
cbt_lib_free(raylib);
|
cbt_lib_free(raylib);
|
||||||
|
|
||||||
cbt_proc_wait(cbt_proc_new(CBT_PROC_AUTO, cbt_cc, "clock.c", "-o", "clock",
|
CBT_FAIL(compile_file("extras/clock.c", "extras/clock") == false);
|
||||||
"libraylib.a", "-lm", "-lpthread"));
|
|
||||||
|
|
||||||
cbt_cleanup();
|
cbt_cleanup();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue