-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Help macOS builds to get further before failing.
- Loading branch information
Showing
8 changed files
with
125 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef MACFUNCTIONS_H | ||
#define MACFUNCTIONS_H | ||
|
||
#if __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
const char* getMacLanguage(); | ||
|
||
void getMacApplicationSupportFolder(char* buffer, int len); | ||
|
||
#if __cplusplus | ||
} | ||
#endif | ||
|
||
#endif //MACFUNCTIONS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
#import <Cocoa/Cocoa.h> | ||
#import "MacFunctions.h" | ||
|
||
static char macLanguage[3] = " "; | ||
|
||
const char* getMacLanguage() { | ||
NSUserDefaults * userDefaults = [NSUserDefaults standardUserDefaults]; | ||
NSArray * languageArray = [userDefaults objectForKey:@"AppleLanguages"]; | ||
NSString * firstLanguage = [languageArray objectAtIndex:0]; | ||
|
||
macLanguage[0] = [firstLanguage characterAtIndex:0]; | ||
macLanguage[1] = [firstLanguage characterAtIndex:1]; | ||
|
||
return macLanguage; | ||
} | ||
|
||
void getMacApplicationSupportFolder(char* buffer, int len) { | ||
FSRef appSupportFolder; | ||
OSErr error = noErr; | ||
NSString* appSupportFolderString; | ||
|
||
error = FSFindFolder(kUserDomain, kApplicationSupportFolderType, true, &appSupportFolder); | ||
|
||
if(error == noErr) { | ||
CFURLRef url = CFURLCreateFromFSRef(kCFAllocatorDefault, &appSupportFolder); | ||
appSupportFolderString = [(NSURL*) url path]; | ||
} else { | ||
appSupportFolderString = [@"~/Library/Application Support" stringByExpandingTildeInPath]; | ||
} | ||
|
||
[appSupportFolderString getCString:buffer maxLength:len-1 encoding:NSUTF8StringEncoding]; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
message(STATUS "Configuring macOS") | ||
include_directories(AFTER "${CMAKE_CURRENT_LIST_DIR}../../../MacOSX") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"overlay-ports": [ | ||
"../config/ports/sdl2" | ||
], | ||
"overlay-triplets": [ | ||
"../config/triplets" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"dependencies": [ | ||
"fmt", | ||
"gtest", | ||
"lodepng", | ||
"ms-gsl", | ||
"sdl2", | ||
"sdl2-mixer", | ||
"sdl2-ttf", | ||
"soxr", | ||
"openssl" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters