Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warrning. deprecated can_build signature. #118

Open
Valeryn4 opened this issue Mar 3, 2020 · 3 comments
Open

Warrning. deprecated can_build signature. #118

Valeryn4 opened this issue Mar 3, 2020 · 3 comments

Comments

@Valeryn4
Copy link

Valeryn4 commented Mar 3, 2020

OS target (Android/iOS): All

Godot version: 3.2+

Issue description:

Warning: module 'admob' uses a deprecated `can_build` signature in its config.py file, it should be `can_build(env, platform)`.
Warning: module 'share' uses a deprecated `can_build` signature in its config.py file, it should be `can_build(env, platform)`.

In all modules, obsolete functions are used. Why not fix it? It takes a few minutes.

before

def can_build(plat):
    return plat == "iphone" or plat == "android"

after

def can_build(env, platform):
    return platform == "iphone" or platform == "android"

I would also suggest modular compilation for the iPhone, and maybe this might work for the android. Further reducing compilation time and testing time.
Now, if I change the modules - it takes a very long link and assembly

for example, you can take modules/arkit or modules/camera
SCsub:

Import('env')
Import('env_modules')

env_my_modules = env_modules.Clone() ##create new module

if (env["platform"] == "iphone"):
   modules_sources = [] ##create array source files
   env_my_modules.add_source_files(modules_sources, "*.cpp") ##add all CPP
   env_my_modules.add_source_files(modules_sources, "ios/src/*.mm") ##add all MM
   
   mod_lib = env_modules.add_library('#bin/libgodot_my_module' + env['LIBSUFFIX'], #add lib
   modules_sources)

in console iphone after build

$ lipo -create bin/libgodot_my_module.iphone.opt.arm.a bin/libgodot_my_module.iphone.opt.arm64.a bin/libgodot_my_module.iphone.opt.x86.a bin/libgodot_my_module.iphone.opt.x86_64.a -output bin/libgodot_my_module.iphone.release.fat.a
$ cp bin/libgodot_my_module.iphone.release.fat.a ~/godot_template_iphone/
$ zip -r iphone_my_template.zip ~/godot_template_iphone/*

Copy file to template directory

@pchasco
Copy link

pchasco commented May 22, 2020

#119 corrects this issue for Godot 3, but when building for Godot 2 the call to can_build fails the build. Essentially the Godot 2 source expects the signature can_build(platform), whereas the Godot 3 source expects can_build(env, platform). This change was applied to the 2.1.X branch also.

@gumaciel
Copy link
Collaborator

Will do that change @pchasco

@gumaciel
Copy link
Collaborator

@pchasco done, please test it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants