Skip to content

Commit

Permalink
allow building without glfw headers
Browse files Browse the repository at this point in the history
  • Loading branch information
electronstudio committed Jul 2, 2024
1 parent 43630d8 commit 96114ae
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions raylib/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,14 @@ def build_unix():

glfw3_h = get_the_include_path() + "/GLFW/glfw3.h"
if check_header_exists(glfw3_h):
ffibuilder.cdef(pre_process_header(glfw3_h))
ffi_includes += """
#include "GLFW/glfw3.h"
"""

raygui_h = get_the_include_path() + "/raygui.h"
if check_header_exists(raygui_h):
ffibuilder.cdef(pre_process_header(raygui_h))
ffi_includes += """
#define RAYGUI_IMPLEMENTATION
#define RAYGUI_SUPPORT_RICONS
Expand All @@ -141,21 +143,16 @@ def build_unix():

physac_h = get_the_include_path() + "/physac.h"
if check_header_exists(physac_h):
ffibuilder.cdef(pre_process_header(physac_h))
ffi_includes += """
#define PHYSAC_IMPLEMENTATION
#include "physac.h"
"""

ffibuilder.cdef(pre_process_header(raylib_h))
ffibuilder.cdef(pre_process_header(glfw3_h))
ffibuilder.cdef(pre_process_header(rlgl_h))
ffibuilder.cdef(pre_process_header(raymath_h, True))

if os.path.isfile(raygui_h):
ffibuilder.cdef(pre_process_header(raygui_h))
if os.path.isfile(physac_h):
ffibuilder.cdef(pre_process_header(physac_h))

if platform.system() == "Darwin":
print("BUILDING FOR MAC")
extra_link_args = [get_the_lib_path() + '/libraylib.a', '-framework', 'OpenGL', '-framework', 'Cocoa',
Expand Down

0 comments on commit 96114ae

Please sign in to comment.