mirror of
https://github.com/Relintai/terraman_2d.git
synced 2024-11-12 10:15:18 +01:00
91 lines
2.5 KiB
Plaintext
91 lines
2.5 KiB
Plaintext
|
import os
|
||
|
|
||
|
Import('env')
|
||
|
|
||
|
module_env = env.Clone()
|
||
|
|
||
|
has_texture_packer = False
|
||
|
if os.path.isdir('../texture_packer'):
|
||
|
module_env.Append(CPPDEFINES=['TEXTURE_PACKER_PRESENT'])
|
||
|
has_texture_packer = True
|
||
|
|
||
|
if os.path.isdir('../thread_pool'):
|
||
|
module_env.Append(CPPDEFINES=['THREAD_POOL_PRESENT'])
|
||
|
|
||
|
if os.path.isdir('../mesh_data_resource'):
|
||
|
module_env.Append(CPPDEFINES=['MESH_DATA_RESOURCE_PRESENT'])
|
||
|
|
||
|
if os.path.isdir('../props'):
|
||
|
module_env.Append(CPPDEFINES=['PROPS_PRESENT'])
|
||
|
|
||
|
if os.path.isdir('../mesh_utils'):
|
||
|
module_env.Append(CPPDEFINES=['MESH_UTILS_PRESENT'])
|
||
|
|
||
|
sources = [
|
||
|
|
||
|
"register_types.cpp",
|
||
|
|
||
|
"library/terraman_library.cpp",
|
||
|
"library/terraman_library_simple.cpp",
|
||
|
"library/terra_material_cache.cpp",
|
||
|
|
||
|
"nodes/terraman_light.cpp",
|
||
|
|
||
|
"library/terra_surface.cpp",
|
||
|
"library/terra_surface_simple.cpp",
|
||
|
|
||
|
"data/terra_light.cpp",
|
||
|
|
||
|
"meshers/terra_mesher.cpp",
|
||
|
|
||
|
"meshers/blocky/terra_mesher_blocky.cpp",
|
||
|
"meshers/blocky/terra_mesher_liquid_blocky.cpp",
|
||
|
"meshers/default/terra_mesher_default.cpp",
|
||
|
|
||
|
"world/terra_world.cpp",
|
||
|
"world/terra_chunk.cpp",
|
||
|
"world/terra_structure.cpp",
|
||
|
"world/block_terra_structure.cpp",
|
||
|
"world/terra_environment_data.cpp",
|
||
|
|
||
|
"world/blocky/terra_chunk_blocky.cpp",
|
||
|
"world/blocky/terra_world_blocky.cpp",
|
||
|
|
||
|
"world/default/terra_world_default.cpp",
|
||
|
"world/default/terra_chunk_default.cpp",
|
||
|
|
||
|
"level_generator/terraman_level_generator.cpp",
|
||
|
"level_generator/terraman_level_generator_flat.cpp",
|
||
|
|
||
|
"areas/terra_world_area.cpp",
|
||
|
|
||
|
"world/terra_world_editor.cpp",
|
||
|
|
||
|
"thirdparty/lz4/lz4.c",
|
||
|
|
||
|
"world/jobs/terra_job.cpp",
|
||
|
"world/jobs/terra_terrarin_job.cpp",
|
||
|
"world/jobs/terra_mesher_job_step.cpp",
|
||
|
"world/jobs/terra_light_job.cpp",
|
||
|
"world/jobs/terra_prop_job.cpp",
|
||
|
]
|
||
|
|
||
|
if has_texture_packer:
|
||
|
sources.append("library/terraman_library_merger.cpp")
|
||
|
sources.append("library/terraman_library_merger_pcm.cpp")
|
||
|
sources.append("library/terra_surface_merger.cpp")
|
||
|
sources.append("library/terra_material_cache_pcm.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/terraman', 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)
|
||
|
|