More MacOS fixes and stuff
This commit is contained in:
parent
59fd8c4328
commit
617c296fe4
|
@ -3,3 +3,5 @@ cbt_impl.c
|
|||
state
|
||||
add-impl.py
|
||||
raylib
|
||||
libraylib.*
|
||||
extras
|
||||
|
|
21
cbt.c
21
cbt.c
|
@ -2,6 +2,17 @@
|
|||
#define CBT_IMPLEMENTATION
|
||||
#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) {
|
||||
CBT_INIT(argc, argv);
|
||||
|
||||
|
@ -15,14 +26,18 @@ int main(int argc, char **argv) {
|
|||
cbt_lib_cflags(&raylib, "-D_GNU_SOURCE", "-DPLATFORM_DESKTOP",
|
||||
"-DGRAPHICS_API_OPENGL_33", "-Wno-missing-braces",
|
||||
"-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/external/glfw/deps/mingw");
|
||||
cbt_lib_build(raylib, NULL);
|
||||
cbt_lib_free(raylib);
|
||||
|
||||
cbt_proc_wait(cbt_proc_new(CBT_PROC_AUTO, cbt_cc, "clock.c", "-o", "clock",
|
||||
"libraylib.a", "-lm", "-lpthread"));
|
||||
CBT_FAIL(compile_file("extras/clock.c", "extras/clock") == false);
|
||||
|
||||
cbt_cleanup();
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue