Add objc_args in meson when compiling to pass C defines also to bundle_open.m. Default "bundle" option to false to have by default a unix-like build and install. In the run-local script always expect that "bundle" option is to false to have a unix-like install. In the build-package script pass the -Dbundle=true option when building on macos. When setting the resouce path revert to original method using [[NSBundle mainBundle] resourcePath] to have the real resource path when the bundle option will be activated. With the recent commit the function set_macos_bundle_resources will be called only if the "bundle" option is activate and is not used in unix-like mode.
21 lines
529 B
Objective-C
21 lines
529 B
Objective-C
#import <Foundation/Foundation.h>
|
|
#include "lua.h"
|
|
|
|
#ifdef MACOS_USE_BUNDLE
|
|
void set_macos_bundle_resources(lua_State *L)
|
|
{ @autoreleasepool
|
|
{
|
|
NSString* resource_path = [[NSBundle mainBundle] resourcePath];
|
|
lua_pushstring(L, [resource_path UTF8String]);
|
|
lua_setglobal(L, "MACOS_RESOURCES");
|
|
}}
|
|
#endif
|
|
|
|
/* Thanks to mathewmariani, taken from his lite-macos github repository. */
|
|
void enable_momentum_scroll() {
|
|
[[NSUserDefaults standardUserDefaults]
|
|
setBool: YES
|
|
forKey: @"AppleMomentumScrollSupported"];
|
|
}
|
|
|