mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-04 22:15:33 +02:00
Add build option for objc GC type
This commit is contained in:
parent
4348462d84
commit
6e078adeff
3 changed files with 19 additions and 19 deletions
|
@ -65,8 +65,10 @@ global_args += run_command(objfw,'--cppflags').stdout().split()
|
||||||
add_project_arguments(run_command(objfw,'--objcflags').stdout().split(), language:'objc')
|
add_project_arguments(run_command(objfw,'--objcflags').stdout().split(), language:'objc')
|
||||||
add_project_link_arguments(run_command(objfw,'--libs','--ldflags').stdout().split(), language:['objc','objcpp'])
|
add_project_link_arguments(run_command(objfw,'--libs','--ldflags').stdout().split(), language:['objc','objcpp'])
|
||||||
|
|
||||||
if compilers['objc'].get_id() == 'clang'
|
if (compilers['objc'].get_id() == 'clang' and get_option('gc_type') == 'arc' and host_machine.cpu_family() == 'x86_64')
|
||||||
add_project_arguments(run_command(objfw,'--arc').stdout().split(), language: ['objc','objcpp'])
|
add_project_arguments(run_command(objfw,'--arc').stdout().split(), language: ['objc','objcpp'])
|
||||||
|
else
|
||||||
|
add_project_arguments('-fobjc-gc', language: ['objc', 'objcpp'])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
subdir('src')
|
subdir('src')
|
||||||
|
|
|
@ -3,6 +3,7 @@ option('mk', type: 'boolean', value: false, description: 'Build to fit Marin\'s
|
||||||
option('ruby_lib', type: 'string', value: 'ruby', description: 'Name of the Ruby library')
|
option('ruby_lib', type: 'string', value: 'ruby', description: 'Name of the Ruby library')
|
||||||
option('console', type: 'boolean', value: true, description: 'Whether to debug information in the console')
|
option('console', type: 'boolean', value: true, description: 'Whether to debug information in the console')
|
||||||
option('macos_min_version', type: 'string', value: '10.10', description: 'Minimum macOS system version to support')
|
option('macos_min_version', type: 'string', value: '10.10', description: 'Minimum macOS system version to support')
|
||||||
|
option('gc_type', type: 'combo', choices: ['gc','arc'], value: 'arc', description: 'Which method of garbage collection to utilize')
|
||||||
|
|
||||||
option('shared_fluid', type: 'boolean', value: false, description: 'Dynamically link fluidsynth at build time')
|
option('shared_fluid', type: 'boolean', value: false, description: 'Dynamically link fluidsynth at build time')
|
||||||
option('cjk_fallback_font', type: 'boolean', value: false, description: 'Use WenQuanYi Micro Hei as the fallback font')
|
option('cjk_fallback_font', type: 'boolean', value: false, description: 'Use WenQuanYi Micro Hei as the fallback font')
|
||||||
|
|
|
@ -714,28 +714,25 @@ void FileSystem::openReadRaw(SDL_RWops &ops,
|
||||||
// SDL_SaveBMP wants absolute paths
|
// SDL_SaveBMP wants absolute paths
|
||||||
char* FileSystem::normalize(const char *pathname, bool preferred, bool absolute)
|
char* FileSystem::normalize(const char *pathname, bool preferred, bool absolute)
|
||||||
{
|
{
|
||||||
@autoreleasepool
|
char* ret = new char[512];
|
||||||
{
|
id str = [OFMutableString stringWithUTF8String:pathname];
|
||||||
char* ret = new char[512];
|
|
||||||
id str = [OFMutableString stringWithUTF8String:pathname];
|
|
||||||
|
|
||||||
if (absolute)
|
if (absolute)
|
||||||
{
|
{
|
||||||
OFURL* base = [OFURL fileURLWithPath:[[OFFileManager defaultManager] currentDirectoryPath]];
|
OFURL* base = [OFURL fileURLWithPath:[[OFFileManager defaultManager] currentDirectoryPath]];
|
||||||
OFURL* purl = [OFURL fileURLWithPath:str];
|
OFURL* purl = [OFURL fileURLWithPath:str];
|
||||||
OFString* path = [[OFURL URLWithString:[purl string] relativeToURL:base] path];
|
OFString* path = [[OFURL URLWithString:[purl string] relativeToURL:base] path];
|
||||||
str = [OFMutableString stringWithString:path];
|
str = [OFMutableString stringWithString:path];
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
if (preferred)
|
if (preferred)
|
||||||
{
|
{
|
||||||
[str replaceOccurrencesOfString:@"/" withString:@"\\"];
|
[str replaceOccurrencesOfString:@"/" withString:@"\\"];
|
||||||
}
|
|
||||||
#endif
|
|
||||||
strncpy(ret, [[str stringByStandardizingPath] UTF8String], 512);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
strncpy(ret, [[str stringByStandardizingPath] UTF8String], 512);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FileSystem::exists(const char *filename)
|
bool FileSystem::exists(const char *filename)
|
||||||
|
|
Loading…
Add table
Reference in a new issue