Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD build possible, modifications needed #28

Open
llmII opened this issue Oct 26, 2021 · 0 comments
Open

FreeBSD build possible, modifications needed #28

llmII opened this issue Oct 26, 2021 · 0 comments

Comments

@llmII
Copy link

llmII commented Oct 26, 2021

cflags, lflags, and defines need to be FreeBSD specific in this case:

diff --git a/project.janet b/project.janet
index 96e9e81..d954222 100644
--- a/project.janet
+++ b/project.janet
@@ -16,6 +16,7 @@
     :windows '["user32.lib" "gdi32.lib" "winmm.lib" "shell32.lib"]
     :macos '["-lpthread" "-framework" "Cocoa" "-framework" "CoreVideo" "-framework" "IOKit" "-framework" "OpenGL"]
     :linux '["-lpthread" "-lX11"]
+    :freebsd '["-L/usr/local/lib" "-lpthread" "-lX11"]
     #default
     '["-lpthread"]))
 
@@ -24,7 +25,7 @@
 
   :cflags [;default-cflags ;cflags]
 
-  :defines {"PLATFORM_DESKTOP" true "_POSIX_C_SOURCE" "200809L"}
+  :defines {"PLATFORM_DESKTOP" true } # "_POSIX_C_SOURCE" "200809L"}
 
   :source ["src/main.c"
 
@@ -47,6 +48,8 @@
             "src/shapes.h"
             "src/3d.h"]
 
+  :cflags [;default-cflags ;'["-I/usr/local/include"]]
+
   :lflags [;default-lflags ;lflags])
 
 # `jpm run repl` to run a repl with access to jaylib

That illustrates the changes necessary, however, is not fit for actual use (would probably break other platforms) so is mostly provided as documentation.

The other ordeal might be that the cflags, lflags, should be defaults under FreeBSD in jpm but am not sure if that is true or not. Depends on what those are under other platforms. The _POSIX_C_SOURCE define breaks soundcard.h on some platforms supposedly (currently on FreeBSD to our knowledge).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant