terraman_2d/SCsub

93 lines
2.7 KiB
Plaintext
Raw Normal View History

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_2d'):
module_env.Append(CPPDEFINES=['PROPS_2D_PRESENT'])
2021-11-22 22:00:45 +01:00
if os.path.isdir('../mesh_utils'):
module_env.Append(CPPDEFINES=['MESH_UTILS_PRESENT'])
sources = [
"register_types.cpp",
2022-02-22 11:09:36 +01:00
"library/terrain_2d_library.cpp",
"library/terrain_2d_library_simple.cpp",
"library/terrain_2d_material_cache.cpp",
2021-11-22 22:00:45 +01:00
2022-02-22 11:09:36 +01:00
"nodes/terrain_2d_light_node.cpp",
2021-11-22 22:00:45 +01:00
2022-02-22 11:09:36 +01:00
"library/terrain_2d_surface.cpp",
"library/terrain_2d_surface_simple.cpp",
2021-11-22 22:00:45 +01:00
2022-02-22 11:09:36 +01:00
"data/terrain_2d_light.cpp",
2021-11-22 22:00:45 +01:00
2022-02-22 11:09:36 +01:00
"meshers/terrain_2d_mesher.cpp",
2021-11-22 22:00:45 +01:00
"meshers/isometric/terrain_2d_mesher_isometric.cpp",
"meshers/simple/terrain_2d_mesher_simple.cpp",
2022-02-22 11:09:36 +01:00
"meshers/default/terrain_2d_mesher_default.cpp",
2021-11-22 22:00:45 +01:00
2022-02-22 11:09:36 +01:00
"world/terrain_2d_world.cpp",
"world/terrain_2d_chunk.cpp",
"world/terrain_2d_structure.cpp",
"world/block_terrain_2d_structure.cpp",
"world/terrain_2d_environment_data.cpp",
2021-11-22 22:00:45 +01:00
"world/default/terrain_2d_world_default.cpp",
"world/default/terrain_2d_chunk_default.cpp",
"world/simple/terrain_2d_chunk_simple.cpp",
"world/simple/terrain_2d_world_simple.cpp",
2021-11-22 22:00:45 +01:00
"world/isometric/terrain_2d_chunk_isometric.cpp",
"world/isometric/terrain_2d_world_isometric.cpp",
2021-11-22 22:00:45 +01:00
2022-02-22 11:09:36 +01:00
"level_generator/terrain_2d_level_generator.cpp",
"level_generator/terrain_2d_level_generator_flat.cpp",
2021-11-22 22:00:45 +01:00
2022-02-22 11:09:36 +01:00
"areas/terrain_2d_world_area.cpp",
2021-11-22 22:00:45 +01:00
2022-02-22 11:09:36 +01:00
"world/terrain_2d_world_editor.cpp",
2021-11-22 22:00:45 +01:00
"thirdparty/lz4/lz4.c",
2022-02-22 11:09:36 +01:00
"world/jobs/terrain_2d_job.cpp",
"world/jobs/terrain_2d_terrain_job.cpp",
"world/jobs/terrain_2d_light_job.cpp",
"world/jobs/terrain_2d_prop_job.cpp",
2021-11-22 22:00:45 +01:00
]
if has_texture_packer:
2022-02-22 11:09:36 +01:00
sources.append("library/terrain_2d_library_merger.cpp")
sources.append("library/terrain_2d_library_merger_pcm.cpp")
sources.append("library/terrain_2d_surface_merger.cpp")
sources.append("library/terrain_2d_material_cache_pcm.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_2d', source=sources)
2021-11-22 22:00:45 +01:00
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)