Skip to content

Commit 681a250

Browse files
Build objective-c files only on Darwin
1 parent 8854680 commit 681a250

File tree

4 files changed

+2
-16
lines changed

4 files changed

+2
-16
lines changed
File renamed without changes.

certificates/certificates.m renamed to certificates/certificates_darwin.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#import <Foundation/Foundation.h>
22
#import <AppKit/AppKit.h>
3-
#include "certificates.h"
3+
#include "certificates_darwin.h"
44

55
// Used to return error strings (as NSString) as a C-string to the Go code.
66
const char *toErrorString(NSString *errString) {

certificates/install_darwin.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ package certificates
2424
#cgo LDFLAGS: -framework Foundation -framework Security -framework AppKit -ld_classic
2525
2626
#import <Foundation/Foundation.h>
27-
#include "certificates.h"
27+
#include "certificates_darwin.h"
2828
*/
2929
import "C"
3030
import (

certificates/install_default.go

-14
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,6 @@
1717

1818
package certificates
1919

20-
/*
21-
// Importing "certificates.h" here even if it is not used avoids building errors on Ubuntu and Windows.
22-
23-
// Explicitly tell the GCC compiler that the language is Objective-C.
24-
#cgo CFLAGS: -x objective-c
25-
26-
// Pass the list of macOS frameworks needed by this piece of Objective-C code.
27-
// The "-ld_classic" is needed to avoid a wrong warning about duplicate libraries when building with XCode 15.
28-
#cgo LDFLAGS: -framework Foundation -framework Security -framework AppKit -ld_classic
29-
30-
#import <Foundation/Foundation.h>
31-
#include "certificates.h"
32-
*/
33-
3420
import (
3521
"errors"
3622
"time"

0 commit comments

Comments
 (0)