mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 04:11:56 +08:00
[mac] Fix linking issue. Removed warnings.
This commit is contained in:
parent
24eaef1604
commit
008a5c70b9
@ -12,6 +12,7 @@
|
|||||||
#import <WebKit/WebKit.h>
|
#import <WebKit/WebKit.h>
|
||||||
|
|
||||||
#if __has_include(<UniformTypeIdentifiers/UTType.h>)
|
#if __has_include(<UniformTypeIdentifiers/UTType.h>)
|
||||||
|
#define USE_NEW_FILTERS
|
||||||
#import <UniformTypeIdentifiers/UTType.h>
|
#import <UniformTypeIdentifiers/UTType.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -500,10 +500,14 @@
|
|||||||
#ifdef USE_NEW_FILTERS
|
#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];
|
if (@available(macOS 11.0, *)) {
|
||||||
[contentTypes addObject:t];
|
UTType *t = [UTType typeWithFilenameExtension:filter];
|
||||||
|
[contentTypes addObject:t];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (@available(macOS 11.0, *)) {
|
||||||
[dialog setAllowedContentTypes:contentTypes];
|
[dialog setAllowedContentTypes:contentTypes];
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
[dialog setAllowedFileTypes:filterList];
|
[dialog setAllowedFileTypes:filterList];
|
||||||
#endif
|
#endif
|
||||||
|
@ -32,7 +32,8 @@ void processCallback(int callbackID) {
|
|||||||
void processURLRequest(void *ctx, const char* url) {
|
void processURLRequest(void *ctx, const char* url) {
|
||||||
NSLog(@"processURLRequest called");
|
NSLog(@"processURLRequest called");
|
||||||
const char myByteArray[] = { 0x3c,0x68,0x31,0x3e,0x48,0x65,0x6c,0x6c,0x6f,0x20,0x57,0x6f,0x72,0x6c,0x64,0x21,0x3c,0x2f,0x68,0x31,0x3e };
|
const char myByteArray[] = { 0x3c,0x68,0x31,0x3e,0x48,0x65,0x6c,0x6c,0x6f,0x20,0x57,0x6f,0x72,0x6c,0x64,0x21,0x3c,0x2f,0x68,0x31,0x3e };
|
||||||
ProcessURLResponse(ctx, url, "text/html", (void*)myByteArray, 21);
|
// void *inctx, const char *url, int statusCode, const char *contentType, void* data, int datalength
|
||||||
|
ProcessURLResponse(ctx, url, 200, "text/html", (void*)myByteArray, 21);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char _Users_username_Pictures_SaltBae_png[] = {
|
unsigned char _Users_username_Pictures_SaltBae_png[] = {
|
||||||
|
@ -3,13 +3,15 @@ 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"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/wailsapp/wails/v2/internal/system"
|
||||||
|
|
||||||
"github.com/leaanthony/gosod"
|
"github.com/leaanthony/gosod"
|
||||||
wailsRuntime "github.com/wailsapp/wails/v2/internal/frontend/runtime"
|
wailsRuntime "github.com/wailsapp/wails/v2/internal/frontend/runtime"
|
||||||
"github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper"
|
"github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper"
|
||||||
@ -320,13 +322,18 @@ func (b *BaseBuilder) CompileProject(options *Options) error {
|
|||||||
return "1"
|
return "1"
|
||||||
})
|
})
|
||||||
if options.Platform == "darwin" {
|
if options.Platform == "darwin" {
|
||||||
// Determine verison
|
// Determine version so we can link to newer frameworks
|
||||||
|
// Why doesn't CGO have this option?!?!
|
||||||
info, err := system.GetInfo()
|
info, err := system.GetInfo()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
versionSplit := strings.Split(info.OS.Version, ".")
|
versionSplit := strings.Split(info.OS.Version, ".")
|
||||||
addUTIFramework := versionSplit[0] == "11"
|
majorVersion, err := strconv.Atoi(versionSplit[0])
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
addUTIFramework := majorVersion >= 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 != "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user