From d5350b16aed4441cec0f53a077b9d4a3c113856e Mon Sep 17 00:00:00 2001 From: iWas-Coder Date: Sat, 13 Apr 2024 02:57:38 +0200 Subject: [PATCH] fix: use clang instead of gcc on BSD --- GNUmakefile | 5 +++++ README.org | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index e2dcb82..57006f8 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -86,6 +86,10 @@ ifeq ($(shell uname), Darwin) CC = clang MACOS_SPECIFIC_CFLAGS_OPTS = -x objective-c MACOS_SPECIFIC_LDFLAGS_OPTS = -framework Cocoa -framework Carbon -framework CoreVideo -framework OpenGL -framework IOKit +else ifeq ($(shell uname), FreeBSD) + CC = clang +else ifeq ($(shell uname), OpenBSD) + CC = clang endif AR = ar -rc ifdef Q_RSC @@ -117,6 +121,7 @@ endif define RAYLIB_CPPFLAGS $(DISABLE_ASSERTS_OPTS) \ -D PLATFORM_DESKTOP \ + -isystem /usr/local/$(HDR_DIR) \ -isystem /usr/X11R6/$(HDR_DIR) \ -isystem $(RAYLIB_SRC_DIR) \ -isystem $(RAYLIB_SRC_DIR)/external/glfw/$(HDR_DIR) diff --git a/README.org b/README.org index 9e8926c..0aaf331 100644 --- a/README.org +++ b/README.org @@ -111,6 +111,7 @@ You should have received a copy of the GNU General Public License along with Spa - [[#freebsd][FreeBSD]] - [[#openbsd][OpenBSD]] - [[#macos][macOS]] + - [[#compilation--linkage][Compilation & Linkage]] * Project's Roadmap @@ -156,7 +157,7 @@ git clone --recurse-submodules https://github.com/iWas-Coder/sparky These are the packages needed to be able to build /Sparky/ from source, they are divided by distribution/package manager. Also, a command for each one is added to make the installation of these development dependencies as easy and straightforward as possible. - ~make~ -- ~gcc~ +- ~gcc~ / ~clang~ - ~rust~ - ~jq~ - ~libX11~ @@ -192,14 +193,13 @@ sudo emerge -va make gcc rust-bin jq libX11 libXcursor libXrandr libXinerama lib *** FreeBSD #+begin_src sh -sudo pkg install gmake gcc rust jq libX11 libXcursor libXrandr libXinerama libXi +sudo pkg install gmake rust jq libX11 libXcursor libXrandr libXinerama libXi #+end_src *** OpenBSD #+begin_src sh -sudo pkg_add gmake gcc rust jq -sudo ln -s /usr/local/bin/x86_64-unknown-openbsd*-gcc-* /usr/local/bin/gcc +sudo pkg_add gmake rust jq #+end_src *** macOS @@ -207,3 +207,7 @@ sudo ln -s /usr/local/bin/x86_64-unknown-openbsd*-gcc-* /usr/local/bin/gcc #+begin_src sh brew install rust jq #+end_src + +** Compilation & Linkage + +(...)