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

🚧 [WIP] FMOD web support (HTML5) #210

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,18 @@ elif env["platform"] == "android":
env.Append(LIBPATH=[env['fmod_lib_dir'] + 'android/core/lib/' + arch_dir, env['fmod_lib_dir'] + 'android/studio/lib/' + arch_dir])
env.Append(LIBS=[libfmod, libfmodstudio])

elif env["platform"] == "web":
web_path = 'web/%s/lib/fastcomp/bitcode/'
#libfmod_bindings = os.path.join(fmod_lib_dir, web_path % 'core', 'fmod%s_bindings.bc' % lfix)
bitbrain marked this conversation as resolved.
Show resolved Hide resolved
libfmod = os.path.join(fmod_lib_dir, web_path % 'core', 'fmod%s.bc' % lfix)
#libfmodstudio_bindings = os.path.join(fmod_lib_dir, web_path % 'studio', 'fmodstudio%s_bindings.bc' % lfix)
#libfmodstudio = os.path.join(fmod_lib_dir, web_path % 'studio', 'fmodstudio%s.bc' % lfix)

env.Append(CPPPATH=[env['fmod_lib_dir'] + 'web/core/inc/', env['fmod_lib_dir'] + 'web/studio/inc/'])
env.Append(LIBPATH=[env['fmod_lib_dir'] + 'web/core/lib/fastcomp/bitcode/', env['fmod_lib_dir'] + 'web/studio/lib/fastcomp/bitcode/'])
# Instead of LIBS, directly add to LINKFLAGS for explicit paths
env.Append(LINKFLAGS=[libfmod])

#Output is placed in the addons directory of the demo project directly
target = "{}{}/{}.{}.{}".format(
target_path, env["platform"], target_name, env["platform"], env["target"]
Expand Down Expand Up @@ -196,8 +208,9 @@ def copy_fmod_libraries(self, arg, env, executor = None):
source_files = [env.Glob(os.path.join(source_dir, '*.*')) for source_dir in [fmod_core_lib_dir, fmod_studio_lib_dir]]
[[shutil.copy(str(file), addon_fmod_libs_output) for file in files] for files in source_files]


copy_fmod_libraries_action = Action('', copy_fmod_libraries)
AddPostAction(library, copy_fmod_libraries_action)
# web bundles everything inside the final .wasm - no need to export libs
if env["platform"] != "web":
copy_fmod_libraries_action = Action('', copy_fmod_libraries)
AddPostAction(library, copy_fmod_libraries_action)

Default(library)
Loading