mirror of
https://github.com/taigrr/wails.git
synced 2026-04-13 18:38:11 -07:00
Compare commits
5 Commits
v1.16.9
...
obfuscatio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11c9c34958 | ||
|
|
fa380105f4 | ||
|
|
24eaef1604 | ||
|
|
62adcab722 | ||
|
|
e12b630dfb |
@@ -497,16 +497,16 @@
|
|||||||
filters = [filters stringByReplacingOccurrencesOfString:@"*." withString:@""];
|
filters = [filters stringByReplacingOccurrencesOfString:@"*." withString:@""];
|
||||||
filters = [filters stringByReplacingOccurrencesOfString:@" " withString:@""];
|
filters = [filters stringByReplacingOccurrencesOfString:@" " withString:@""];
|
||||||
NSArray *filterList = [filters componentsSeparatedByString:@";"];
|
NSArray *filterList = [filters componentsSeparatedByString:@";"];
|
||||||
if (@available(macOS 10.16, *)) {
|
#ifdef USE_NEW_FILTERS
|
||||||
NSMutableArray *contentTypes = [[NSMutableArray new] autorelease];
|
NSMutableArray *contentTypes = [[NSMutableArray new] autorelease];
|
||||||
for (NSString *filter in filterList) {
|
for (NSString *filter in filterList) {
|
||||||
UTType *t = [UTType typeWithFilenameExtension:filter];
|
UTType *t = [UTType typeWithFilenameExtension:filter];
|
||||||
[contentTypes addObject:t];
|
[contentTypes addObject:t];
|
||||||
}
|
}
|
||||||
[dialog setAllowedContentTypes:contentTypes];
|
[dialog setAllowedContentTypes:contentTypes];
|
||||||
} else {
|
#else
|
||||||
[dialog setAllowedFileTypes:filterList];
|
[dialog setAllowedFileTypes:filterList];
|
||||||
}
|
#endif
|
||||||
} else {
|
} else {
|
||||||
[dialog setAllowsOtherFileTypes:true];
|
[dialog setAllowsOtherFileTypes:true];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ package darwin
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
#cgo CFLAGS: -x objective-c
|
#cgo CFLAGS: -x objective-c
|
||||||
#cgo LDFLAGS: -framework Foundation -framework Cocoa -framework WebKit -framework UniformTypeIdentifiers
|
#cgo LDFLAGS: -framework Foundation -framework Cocoa -framework WebKit
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import "Application.h"
|
#import "Application.h"
|
||||||
#import "WailsContext.h"
|
#import "WailsContext.h"
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package build
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/wailsapp/wails/v2/internal/system"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@@ -319,11 +320,21 @@ func (b *BaseBuilder) CompileProject(options *Options) error {
|
|||||||
return "1"
|
return "1"
|
||||||
})
|
})
|
||||||
if options.Platform == "darwin" {
|
if options.Platform == "darwin" {
|
||||||
|
// Determine verison
|
||||||
|
info, err := system.GetInfo()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
versionSplit := strings.Split(info.OS.Version, ".")
|
||||||
|
addUTIFramework := versionSplit[0] == "11"
|
||||||
// Set the minimum Mac SDK to 10.13
|
// Set the minimum Mac SDK to 10.13
|
||||||
cmd.Env = upsertEnv(cmd.Env, "CGO_LDFLAGS", func(v string) string {
|
cmd.Env = upsertEnv(cmd.Env, "CGO_LDFLAGS", func(v string) string {
|
||||||
if v != "" {
|
if v != "" {
|
||||||
v += " "
|
v += " "
|
||||||
}
|
}
|
||||||
|
if addUTIFramework {
|
||||||
|
v += "-framework UniformTypeIdentifiers "
|
||||||
|
}
|
||||||
v += "-mmacosx-version-min=10.13"
|
v += "-mmacosx-version-min=10.13"
|
||||||
|
|
||||||
return v
|
return v
|
||||||
|
|||||||
Reference in New Issue
Block a user