Skip to content

Commit

Permalink
Use library flags for OCaml library
Browse files Browse the repository at this point in the history
  • Loading branch information
tjammer committed Dec 19, 2024
1 parent 4b84c8f commit a55fdb8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/c/config/configure.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module C = Configurator.V1

let rec link ?(flag = "-l") = function
| [] -> []
| lib :: libs -> (flag ^ " " ^ lib) :: link ~flag libs
| lib :: libs -> "-cclib" :: (flag ^ " " ^ lib) :: link ~flag libs

let () =
C.main ~name:"raylib" (fun c ->
Expand All @@ -15,7 +15,7 @@ let () =
[ "OpenGL"; "Cocoa"; "IOKit"; "CoreAudio"; "CoreVideo" ]
| Some "mingw64" -> link [ "opengl32"; "gdi32"; "winmm"; "pthread" ]
| Some ("netbsd" | "freebsd" | "openbsd" | "bsd" | "bsd_elf") ->
"-L /usr/local/lib"
"-cclib" :: "-L /usr/local/lib"
:: link
[
"GL";
Expand Down
4 changes: 1 addition & 3 deletions src/c/raygui/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
(build_flags_resolver
(vendored
(c_flags :standard "-I../vendor/raygui/src" "-I../vendor/raylib/src")
(c_library_flags
:standard
(:include ../library_flags.sexp))))
(c_library_flags :standard)))
(headers
(include "raygui.h" "raylib.h"))
(type_description
Expand Down
6 changes: 3 additions & 3 deletions src/c/raylib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
(build_flags_resolver
(vendored
(c_flags :standard "-I../vendor/raylib/src")
(c_library_flags
:standard
(:include ../library_flags.sexp))))
(c_library_flags :standard)))
(headers
(include "raylib.h" "rlgl.h" "config.h" "raymath.h"))
(type_description
Expand All @@ -19,4 +17,6 @@
(functor Functions))
(generated_types Raylib_types_generated)
(generated_entry_point Raylib_generated))
(library_flags
(:include ../library_flags.sexp))
(foreign_archives ../raylib))
4 changes: 1 addition & 3 deletions src/c/rlgl/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
(build_flags_resolver
(vendored
(c_flags :standard "-I../vendor/raylib/src")
(c_library_flags
:standard
(:include ../library_flags.sexp))))
(c_library_flags :standard)))
(headers
(include "rlgl.h"))
(type_description
Expand Down

0 comments on commit a55fdb8

Please sign in to comment.