mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 01:15:35 +00:00
all: add support for macOS to flake.nix
The Nix version of the macOS toolchain has difficulties compiling Objective-C modules; disable modules instead of figuring out why. It also doesn't include any frameworks automatically; add them explicitly. While here, move suppression of OpenGL deprecation to a GL-specific file. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -16,6 +16,9 @@ import (
|
||||
)
|
||||
|
||||
/*
|
||||
#cgo CFLAGS: -DGL_SILENCE_DEPRECATION -xobjective-c -fobjc-arc
|
||||
#cgo LDFLAGS: -framework OpenGL
|
||||
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include <CoreGraphics/CoreGraphics.h>
|
||||
#include <AppKit/AppKit.h>
|
||||
|
||||
+1
-2
@@ -2,8 +2,7 @@
|
||||
|
||||
// +build darwin,!ios,nometal
|
||||
|
||||
@import AppKit;
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include <OpenGL/OpenGL.h>
|
||||
#include "_cgo_export.h"
|
||||
|
||||
+4
-3
@@ -12,10 +12,11 @@ import (
|
||||
)
|
||||
|
||||
/*
|
||||
#cgo CFLAGS: -Werror -xobjective-c -fmodules -fobjc-arc
|
||||
#cgo CFLAGS: -Werror -xobjective-c -fobjc-arc
|
||||
#cgo LDFLAGS: -framework QuartzCore -framework Metal
|
||||
|
||||
@import Metal;
|
||||
@import QuartzCore.CAMetalLayer;
|
||||
#import <Metal/Metal.h>
|
||||
#import <QuartzCore/CAMetalLayer.h>
|
||||
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
|
||||
+3
-5
@@ -6,12 +6,10 @@
|
||||
package app
|
||||
|
||||
/*
|
||||
#cgo CFLAGS: -Werror -xobjective-c -fmodules -fobjc-arc
|
||||
|
||||
@import AppKit;
|
||||
|
||||
@import QuartzCore.CAMetalLayer;
|
||||
#cgo CFLAGS: -Werror -xobjective-c -fobjc-arc
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <QuartzCore/CAMetalLayer.h>
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
CALayer *gio_layerFactory(void) {
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: Unlicense OR MIT
|
||||
|
||||
@import Dispatch;
|
||||
@import Foundation;
|
||||
#import <Dispatch/Dispatch.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#include "_cgo_export.h"
|
||||
|
||||
|
||||
+2
-1
@@ -24,7 +24,8 @@ import (
|
||||
)
|
||||
|
||||
/*
|
||||
#cgo CFLAGS: -DGL_SILENCE_DEPRECATION -Werror -Wno-deprecated-declarations -fmodules -fobjc-arc -x objective-c
|
||||
#cgo CFLAGS: -Werror -Wno-deprecated-declarations -fobjc-arc -x objective-c
|
||||
#cgo LDFLAGS: -framework AppKit -framework QuartzCore
|
||||
|
||||
#include <AppKit/AppKit.h>
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
// +build darwin,!ios
|
||||
|
||||
@import AppKit;
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
#include "_cgo_export.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user