From b463903533dcba13c9bc9fb044b50b637e5cffa8 Mon Sep 17 00:00:00 2001 From: M374LX Date: Tue, 11 Aug 2026 17:48:50 -0300 Subject: [PATCH] Add QuartzCore when building for macOS to other build files --- build.zig | 1 + examples/CMakeLists.txt | 1 + examples/Makefile | 2 +- examples/Makefile.Web | 2 +- examples/others/rlgl_standalone.c | 2 +- projects/CMake/CMakeLists.txt | 1 + projects/CodeBlocks/core_basic_window.cbp | 2 ++ projects/VSCode/Makefile | 2 +- projects/scripts/build-osx.sh | 4 ++-- tools/rexm/Makefile | 2 +- 10 files changed, 12 insertions(+), 7 deletions(-) diff --git a/build.zig b/build.zig index 00caf0e70..6beab5aee 100644 --- a/build.zig +++ b/build.zig @@ -139,6 +139,7 @@ pub fn linkMacOS(b: *std.Build, mod: *std.Build.Module) void { mod.linkFramework("CoreGraphics", .{}); mod.linkFramework("AppKit", .{}); mod.linkFramework("IOKit", .{}); + mod.linkFramework("QuartzCore", .{}); } fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, options: Options) !*std.Build.Step.Compile { diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 079b9cb01..cdc52af88 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -189,6 +189,7 @@ foreach (example_source ${example_sources}) target_link_libraries(${example_name} "-framework IOKit") target_link_libraries(${example_name} "-framework Cocoa") target_link_libraries(${example_name} "-framework OpenGL") + target_link_libraries(${example_name} "-framework QuartzCore") endif() elseif (${PLATFORM} MATCHES "RGFW") diff --git a/examples/Makefile b/examples/Makefile index 3e1844fc3..e38c136e8 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -418,7 +418,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) ifeq ($(PLATFORM_OS),OSX) # Libraries for OSX 10.9 desktop compiling # NOTE: Required packages: libopenal-dev libegl1-mesa-dev - LDLIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo + LDLIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo -framework QuartzCore endif ifeq ($(PLATFORM_OS),BSD) # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling diff --git a/examples/Makefile.Web b/examples/Makefile.Web index 709072be1..3f8e4176d 100644 --- a/examples/Makefile.Web +++ b/examples/Makefile.Web @@ -411,7 +411,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) ifeq ($(PLATFORM_OS),OSX) # Libraries for OSX 10.9 desktop compiling # NOTE: Required packages: libopenal-dev libegl1-mesa-dev - LDLIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo + LDLIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo -framework QuartzCore endif ifeq ($(PLATFORM_OS),BSD) # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling diff --git a/examples/others/rlgl_standalone.c b/examples/others/rlgl_standalone.c index 094884ffd..e14e0d64c 100644 --- a/examples/others/rlgl_standalone.c +++ b/examples/others/rlgl_standalone.c @@ -24,7 +24,7 @@ * * APPLE COMPILATION: * gcc -o rlgl_standalone rlgl_standalone.c -I../../src -Iexternal/include -Lexternal/lib \ -* -lglfw3 -framework CoreVideo -framework OpenGL -framework IOKit -framework Cocoa +* -lglfw3 -framework CoreVideo -framework OpenGL -framework IOKit -framework Cocoa -framework QuartzCore * -Wno-deprecated-declarations -std=c99 -DGRAPHICS_API_OPENGL_33 * * diff --git a/projects/CMake/CMakeLists.txt b/projects/CMake/CMakeLists.txt index b1d307489..77ebd27da 100644 --- a/projects/CMake/CMakeLists.txt +++ b/projects/CMake/CMakeLists.txt @@ -38,4 +38,5 @@ if (APPLE) target_link_libraries(${PROJECT_NAME} "-framework IOKit") target_link_libraries(${PROJECT_NAME} "-framework Cocoa") target_link_libraries(${PROJECT_NAME} "-framework OpenGL") + target_link_libraries(${PROJECT_NAME} "-framework QuartzCore") endif() diff --git a/projects/CodeBlocks/core_basic_window.cbp b/projects/CodeBlocks/core_basic_window.cbp index ab9fe58a1..93e16bb11 100644 --- a/projects/CodeBlocks/core_basic_window.cbp +++ b/projects/CodeBlocks/core_basic_window.cbp @@ -24,6 +24,7 @@ + @@ -44,6 +45,7 @@ + diff --git a/projects/VSCode/Makefile b/projects/VSCode/Makefile index 4f6d03b31..322e700bb 100644 --- a/projects/VSCode/Makefile +++ b/projects/VSCode/Makefile @@ -321,7 +321,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),OSX) # Libraries for OSX 10.9 desktop compiling # NOTE: Required packages: libopenal-dev libegl1-mesa-dev - LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa -framework IOKit + LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa -framework IOKit -framework QuartzCore endif ifeq ($(PLATFORM_OS),BSD) # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling diff --git a/projects/scripts/build-osx.sh b/projects/scripts/build-osx.sh index d4f8ab217..07d0c8fdb 100755 --- a/projects/scripts/build-osx.sh +++ b/projects/scripts/build-osx.sh @@ -89,13 +89,13 @@ OUTPUT_DIR="builds/osx" COMPILATION_FLAGS="-std=c99 -O2 -flto" FINAL_COMPILE_FLAGS="-s" WARNING_FLAGS="-Wall -Wextra -Wpedantic" -LINK_FLAGS="-flto -framework OpenGL -framework OpenAL -framework IOKit -framework CoreVideo -framework Cocoa" +LINK_FLAGS="-flto -framework OpenGL -framework OpenAL -framework IOKit -framework CoreVideo -framework Cocoa -framework QuartzCore" # Debug changes to flags if [ -n "$BUILD_DEBUG" ]; then OUTPUT_DIR="builds-debug/osx" COMPILATION_FLAGS="-std=c99 -O0 -g" FINAL_COMPILE_FLAGS="" - LINK_FLAGS="-framework OpenGL -framework OpenAL -framework IOKit -framework CoreVideo -framework Cocoa" + LINK_FLAGS="-framework OpenGL -framework OpenAL -framework IOKit -framework CoreVideo -framework Cocoa -framework QuartzCore" fi # Display what we're doing diff --git a/tools/rexm/Makefile b/tools/rexm/Makefile index 6d061a6f6..455818b0f 100644 --- a/tools/rexm/Makefile +++ b/tools/rexm/Makefile @@ -290,7 +290,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM_OS),OSX) # Libraries for OSX 10.9 desktop compiling # NOTE: Required packages: libopenal-dev libegl1-mesa-dev - LDLIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo + LDLIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo -framework QuartzCore endif ifeq ($(PLATFORM_OS),BSD) # Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling