The module can now be built as a shared library.

This commit is contained in:
Relintai 2020-01-03 16:57:25 +01:00
parent fbf5d0d634
commit 189810d164
2 changed files with 28 additions and 9 deletions

2
.gitignore vendored
View File

@ -5,4 +5,4 @@
*.pyc
*.obj
*.bc
*.os

35
SCsub
View File

@ -1,16 +1,35 @@
import os
Import('env')
env.add_source_files(env.modules_sources,"register_types.cpp")
module_env = env.Clone()
env.add_source_files(env.modules_sources,"texture_packer.cpp")
env.add_source_files(env.modules_sources,"rectpack2D/pack.cpp")
sources = [
"register_types.cpp",
env.add_source_files(env.modules_sources,"texture_merger.cpp")
"texture_packer.cpp",
"rectpack2D/pack.cpp",
env.add_source_files(env.modules_sources,"texture_resource/packer_image_resource.cpp")
"texture_merger.cpp",
env.add_source_files(env.modules_sources,"texture_resource/editor_plugin_packer_image_resource.cpp")
env.add_source_files(env.modules_sources,"texture_resource/packer_image_resource_importer.cpp")
"texture_resource/packer_image_resource.cpp",
env.add_source_files(env.modules_sources,"layers/texture_layer_merger.cpp")
"texture_resource/editor_plugin_packer_image_resource.cpp",
"texture_resource/packer_image_resource_importer.cpp",
"layers/texture_layer_merger.cpp",
]
if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes':
# Shared lib compilation
module_env.Append(CCFLAGS=['-fPIC'])
module_env['LIBS'] = []
shared_lib = module_env.SharedLibrary(target='#bin/texture_packer', source=sources)
shared_lib_shim = shared_lib[0].name.rsplit('.', 1)[0]
env.Append(LIBS=[shared_lib_shim])
env.Append(LIBPATH=['#bin'])
else:
# Static compilation
module_env.add_source_files(env.modules_sources, sources)