5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 01:13:03 +08:00

[mac] Fix linking issue. Removed warnings.

This commit is contained in:
Lea Anthony 2021-12-11 20:06:42 +11:00
parent 24eaef1604
commit 008a5c70b9
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405
4 changed files with 19 additions and 6 deletions

View File

@ -12,6 +12,7 @@
#import <WebKit/WebKit.h>
#if __has_include(<UniformTypeIdentifiers/UTType.h>)
#define USE_NEW_FILTERS
#import <UniformTypeIdentifiers/UTType.h>
#endif

View File

@ -500,10 +500,14 @@
#ifdef USE_NEW_FILTERS
NSMutableArray *contentTypes = [[NSMutableArray new] autorelease];
for (NSString *filter in filterList) {
UTType *t = [UTType typeWithFilenameExtension:filter];
[contentTypes addObject:t];
if (@available(macOS 11.0, *)) {
UTType *t = [UTType typeWithFilenameExtension:filter];
[contentTypes addObject:t];
}
}
if (@available(macOS 11.0, *)) {
[dialog setAllowedContentTypes:contentTypes];
}
#else
[dialog setAllowedFileTypes:filterList];
#endif

View File

@ -32,7 +32,8 @@ void processCallback(int callbackID) {
void processURLRequest(void *ctx, const char* url) {
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 };
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[] = {

View File

@ -3,13 +3,15 @@ package build
import (
"bytes"
"fmt"
"github.com/wailsapp/wails/v2/internal/system"
"os"
"os/exec"
"path/filepath"
"runtime"
"strconv"
"strings"
"github.com/wailsapp/wails/v2/internal/system"
"github.com/leaanthony/gosod"
wailsRuntime "github.com/wailsapp/wails/v2/internal/frontend/runtime"
"github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper"
@ -320,13 +322,18 @@ func (b *BaseBuilder) CompileProject(options *Options) error {
return "1"
})
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()
if err != nil {
return err
}
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
cmd.Env = upsertEnv(cmd.Env, "CGO_LDFLAGS", func(v string) string {
if v != "" {