diff --git a/meson.build b/meson.build new file mode 100644 index 000000000..7eabfb270 --- /dev/null +++ b/meson.build @@ -0,0 +1,303 @@ +# Experimental Meson build file +# https://mesonbuild.com + +# build and run (tested on Arch Linux): +# mkdir subprojects +# meson wrap install nlohmann_json +# meson setup mesonbuilddir +# meson compile -C mesonbuilddir +# mesonbuilddir/eternal-lands + +# clean up: +# rm -rf subprojects/ mesonbuilddir/ + +project('Eternal-Lands', ['c', 'cpp'], version: '1.9.6.1-git') + +build_defs = [ + '-DCUSTOM_UPDATE', + '-DCLUSTER_INSIDES', + '-DCUSTOM_LOOK', + '-DFUZZY_PATHS', + '-DNEW_SOUND', + '-DPNG_SCREENSHOT', + '-DUSE_INLINE', + '-DBANDWIDTH_SAVINGS', + '-DANIMATION_SCALING', + '-DFASTER_MAP_LOAD', + '-DFASTER_STARTUP', + '-DMIDDLE_MOUSE_PASTE', + '-DNEW_EYES', + '-DNEW_CURSOR', + '-DLINUX', + '-DFSAA', + '-DJSON_FILES', + '-DTTF', + '-DUSE_SSL', + '-DPACKET_COMPRESSION', + '-DELC', + '-D_7ZIP_ST' +] + +c_src = [ + '2d_objects.c', + '3d_objects.c', + 'actors.c', + 'actor_scripts.c', + 'alphamap.c', + 'asc.c', + 'astrology.c', + 'bags.c', + 'bbox_tree.c', + 'buddy.c', + 'buffs.c', + 'cache.c', + 'cal.c', + 'calc.c', + 'chat.c', + 'cluster.c', + 'colors.c', + 'console.c', + 'consolewin.c', + 'counters.c', + 'cursors.c', + 'custom_update.c', + 'dds.c', + 'ddsimage.c', + 'dialogues.c', + 'draw_scene.c', + 'elconfig.c', + 'el_memory.c', + 'elwindows.c', + 'emotes.c', + 'encyclopedia.c', + 'errors.c', + 'events.c', + 'ext_protocol_shared.c', + 'eye_candy_debugwin.c', + 'filter.c', + 'framebuffer.c', + 'frustum.c', + 'fsaa/fsaa.c', + 'fsaa/fsaa_glx.c', + 'gamewin.c', + 'gl_init.c', + 'hash.c', + 'help.c', + 'highlight.c', + 'hud.c', + 'hud_misc_window.c', + 'hud_quickbar_window.c', + 'hud_quickspells_window.c', + 'hud_statsbar_window.c', + 'ignore.c', + 'image.c', + 'image_loading.c', + 'init.c', + 'interface.c', + 'io/e3d_io.c', + 'io/elc_io.c', + 'io/elfilewrapper.c', + 'io/elpathwrapper.c', + 'io/fileutil.c', + 'io/half.c', + 'io/ioapi.c', + 'io/map_io.c', + 'io/normal.c', + 'io/unzip.c', + 'io/xmlcallbacks.c', + 'io/zip.c', + 'io/ziputil.c', + 'items.c', + 'keys.c', + 'knowledge.c', + 'langselwin.c', + 'lights.c', + 'list.c', + 'load_gl_extensions.c', + 'loading_win.c', + 'loginwin.c', + 'main.c', + 'makeargv.c', + 'manufacture.c', + 'map.c', + 'mapwin.c', + 'md5.c', + 'mines.c', + 'minimap.c', + 'misc.c', + 'missiles.c', + 'multiplayer.c', + 'new_actors.c', + 'new_character.c', + 'new_update.c', + 'notepad.c', + 'openingwin.c', + 'particles.c', + 'paste.c', + 'pathfinder.c', + 'pm_log.c', + 'popup.c', + 'queue.c', + 'reflection.c', + 'rules.c', + 'serverpopup.c', + 'servers.c', + 'session.c', + 'shader/noise.c', + 'shader/shader.c', + 'shadows.c', + 'skeletons.c', + 'skills.c', + 'sky.c', + 'sound.c', + 'special_effects.c', + 'spells.c', + 'stats.c', + 'storage.c', + 'tabs.c', + 'text_aliases.c', + 'text.c', + 'textures.c', + 'tile_map.c', + 'timers.c', + 'trade.c', + 'translate.c', + 'update.c', + 'url.c', + 'weather.c', + 'widgets.c', + 'xz/7zCrc.c', + 'xz/7zCrcOpt.c', + 'xz/Alloc.c', + 'xz/Bra86.c', + 'xz/Bra.c', + 'xz/BraIA64.c', + 'xz/CpuArch.c', + 'xz/Delta.c', + 'xz/LzFind.c', + 'xz/Lzma2Dec.c', + 'xz/Lzma2Enc.c', + 'xz/LzmaDec.c', + 'xz/LzmaEnc.c', + 'xz/Sha256.c', + 'xz/Xz.c', + 'xz/XzCrc64.c', + 'xz/XzDec.c', + 'xz/XzEnc.c' +] + +cpp_src = [ + 'achievements.cpp', + 'actor_init.cpp', + 'actors_list.cpp', + 'books.cpp', + 'cal3d_wrapper.cpp', + 'command_queue.cpp', + 'connection.cpp', + 'context_menu.cpp', + 'cppwindows.cpp', + 'cppwindows.cpp', + 'elloggingwrapper.cpp', + 'engine/hardwarebuffer.cpp', + 'engine/logging.cpp', + 'exceptions/extendedexception.cpp', + 'eye_candy/effect_bag.cpp', + 'eye_candy/effect_breath.cpp', + 'eye_candy/effect_campfire.cpp', + 'eye_candy/effect_candle.cpp', + 'eye_candy/effect_cloud.cpp', + 'eye_candy/effect_firefly.cpp', + 'eye_candy/effect_fountain.cpp', + 'eye_candy/effect_glow.cpp', + 'eye_candy/effect_harvesting.cpp', + 'eye_candy/effect_impact.cpp', + 'eye_candy/effect_lamp.cpp', + 'eye_candy/effect_mines.cpp', + 'eye_candy/effect_missile.cpp', + 'eye_candy/effect_ongoing.cpp', + 'eye_candy/effect_selfmagic.cpp', + 'eye_candy/effect_smoke.cpp', + 'eye_candy/effect_staff.cpp', + 'eye_candy/effect_summon.cpp', + 'eye_candy/effect_sword.cpp', + 'eye_candy/effect_targetmagic.cpp', + 'eye_candy/effect_teleporter.cpp', + 'eye_candy/effect_wind.cpp', + 'eye_candy/eye_candy.cpp', + 'eye_candy/kepler_orbit.cpp', + 'eye_candy/math_cache.cpp', + 'eye_candy/orbital_mover.cpp', + 'eye_candy_wrapper.cpp', + 'font.cpp', + 'hud_indicators.cpp', + 'hud_timer.cpp', + 'icon_window.cpp', + 'io/cal3d_io_wrapper.cpp', + 'ipaddress.cpp', + 'item_info.cpp', + 'item_lists.cpp', + 'json_io.cpp', + 'named_colours.cpp', + 'optimizer.cpp', + 'password_manager.cpp', + 'quest_log.cpp', + 'select.cpp', + 'sendvideoinfo.cpp', + 'socket.cpp', + 'textpopup.cpp', + 'trade_log.cpp', + 'user_menus.cpp', + 'xml/xmlhelper.cpp', + 'xor_cipher.cpp' +] + +deps = [ + dependency('sdl2'), + dependency('sdl2_image'), + dependency('sdl2_net'), + dependency('sdl2_ttf'), + dependency('nlohmann_json'), + dependency('libxml2'), + dependency('libpng'), + dependency('zlib'), + dependency('gl'), + dependency('x11'), + dependency('openssl'), + dependency('cal3d'), + dependency('openal'), + dependency('glu'), + dependency('ogg'), + dependency('vorbis'), + dependency('vorbisfile'), + dependency('sndfile') +] + +executable( + 'eternal-lands', + + dependencies: [ deps ], + + c_args: [ + '-Wall', + '-Wdeclaration-after-statement', + '-W', + '-Wno-unused-parameter', + '-Wno-sign-compare', + '-D_GNU_SOURCE=1', + '-std=c18', + build_defs + ], + + cpp_args: [ + '-Wall', + '-W', + '-Wno-unused-parameter', + '-Wno-sign-compare', + '-Wno-cast-function-type', + '-D_GNU_SOURCE=1', + '-std=c++20', + build_defs + ], + + sources: [ c_src, cpp_src ] +)