Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8854680

Browse files
committedMay 13, 2024·
Fix building errors caused by objective-c files on Ubuntu and Windows
1 parent 34fae24 commit 8854680

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
 

‎certificates/install_default.go

+14
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@
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+
2034
import (
2135
"errors"
2236
"time"

0 commit comments

Comments
 (0)
Please sign in to comment.