2021-11-22 22:00:45 +01:00
|
|
|
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",
|
|
|
|
|
2021-11-22 23:51:16 +01:00
|
|
|
"library/terraman_library_2d.cpp",
|
|
|
|
"library/terraman_library_simple_2d.cpp",
|
|
|
|
"library/terra_material_cache_2d.cpp",
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2021-11-22 23:51:16 +01:00
|
|
|
"nodes/terraman_light_2d.cpp",
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2021-11-22 23:51:16 +01:00
|
|
|
"library/terra_surface_2d.cpp",
|
|
|
|
"library/terra_surface_simple_2d.cpp",
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2021-11-22 23:51:16 +01:00
|
|
|
"data/terra_light_2d.cpp",
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2021-11-22 23:51:16 +01:00
|
|
|
"meshers/terra_mesher_2d.cpp",
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2021-11-22 23:51:16 +01:00
|
|
|
"meshers/blocky/terra_mesher_blocky_2d.cpp",
|
|
|
|
"meshers/blocky/terra_mesher_liquid_blocky_2d.cpp",
|
|
|
|
"meshers/default/terra_mesher_default_2d.cpp",
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2021-11-22 23:51:16 +01:00
|
|
|
"world/terra_world_2d.cpp",
|
|
|
|
"world/terra_chunk_2d.cpp",
|
|
|
|
"world/terra_structure_2d.cpp",
|
|
|
|
"world/block_terra_structure_2d.cpp",
|
|
|
|
"world/terra_environment_data_2d.cpp",
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2021-11-22 23:51:16 +01:00
|
|
|
"world/blocky/terra_chunk_blocky_2d.cpp",
|
|
|
|
"world/blocky/terra_world_blocky_2d.cpp",
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2021-11-22 23:51:16 +01:00
|
|
|
"world/default/terra_world_default_2d.cpp",
|
|
|
|
"world/default/terra_chunk_default_2d.cpp",
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2021-11-22 23:51:16 +01:00
|
|
|
"level_generator/terraman_level_generator_2d.cpp",
|
|
|
|
"level_generator/terraman_level_generator_flat_2d.cpp",
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2021-11-22 23:51:16 +01:00
|
|
|
"areas/terra_world_area_2d.cpp",
|
2021-11-22 22:00:45 +01:00
|
|
|
|
2021-11-22 23:51:16 +01:00
|
|
|
"world/terra_world_2d_editor.cpp",
|
2021-11-22 22:00:45 +01:00
|
|
|
|
|
|
|
"thirdparty/lz4/lz4.c",
|
|
|
|
|
2021-11-22 23:51:16 +01:00
|
|
|
"world/jobs/terra_job_2d.cpp",
|
|
|
|
"world/jobs/terra_terrarin_job_2d.cpp",
|
|
|
|
"world/jobs/terra_mesher_job_step_2d.cpp",
|
|
|
|
"world/jobs/terra_light_job_2d.cpp",
|
|
|
|
"world/jobs/terra_prop_job_2d.cpp",
|
2021-11-22 22:00:45 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
if has_texture_packer:
|
2021-11-22 23:51:16 +01:00
|
|
|
sources.append("library/terraman_library_merger_2d.cpp")
|
|
|
|
sources.append("library/terraman_library_merger_pcm_2d.cpp")
|
|
|
|
sources.append("library/terra_surface_merger_2d.cpp")
|
|
|
|
sources.append("library/terra_material_cache_pcm_2d.cpp")
|
2021-11-22 22:00:45 +01:00
|
|
|
|
|
|
|
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)
|
|
|
|
|