diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..929a251 --- /dev/null +++ b/meson.build @@ -0,0 +1,73 @@ +project('MacroLibX', + ['c', 'cpp'], + version : '2.2.2', + license : 'MIT', + meson_version : '>= 1.9.0', + default_options : ['warning_level=2', 'optimization=3', 'cpp_std=c++20']) + +add_project_arguments('-Wno-error=', language : 'c') +add_project_arguments('-fPIC', language : 'c') +add_project_arguments('-DSDL_MAIN_HANDLED', language : 'c') + +if get_option('force_integrated_gpu') + add_project_arguments('-DFORCE_INTEGRATED_GPU', language : 'c') +endif + +if get_option('graphics_memory_dump') + add_project_arguments('-DGRAPHICS_MEMORY_DUMP', language : 'c') +endif + +if get_option('profiler') + add_project_arguments('-DPROFILER_ENABLED', language : 'c') +endif + +if get_option('force_wayland') + add_project_arguments('-DFORCE_WAYLAND', language : 'c') +endif + +if get_option('disable_all_safeties') + add_project_arguments('-DDISABLE_ALL_SAFETIES', language : 'c') +endif + +includes_directories = [ + include_directories('includes'), + include_directories('runtime/Includes'), + include_directories('runtime/Sources'), + include_directories('third_party'), +] + +subdir('runtime/Sources') + +mlx_headers = [ + 'includes/mlx.h', + 'includes/mlx_extended.h', + 'includes/mlx_profile.h' +] + +install_headers(mlx_headers) + +deps = [ + dependency('sdl2'), +] + +libmlx = library('mlx', + sources, + include_directories : includes_directories, + dependencies : deps, + install : true) + +libmlx_dep = declare_dependency( + include_directories: includes_directories, + dependencies : deps, + link_with : libmlx) + +# PKG CONFIG GENERATION +pkg_mod = import('pkgconfig') + +pkg_mod.generate( + libmlx, + name : 'mlx', + description : 'MacroLibX Library', + version : meson.project_version(), + subdirs : ['.'], +) \ No newline at end of file diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..c943a18 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,29 @@ +option('force_integrated_gpu', + type : 'boolean', + value : false, + description : 'Force the application to use the integrated GPU if available.' +) + +option('graphics_memory_dump', + type : 'boolean', + value : false, + description : 'Enable graphics memory dump for debugging purposes.' +) + +option('profiler', + type : 'boolean', + value : false, + description : 'Enable profiler for performance analysis.' +) + +option('force_wayland', + type : 'boolean', + value : false, + description : 'Force the application to use Wayland display server.' +) + +option('disable_all_safeties', + type : 'boolean', + value : false, + description : 'Disable all safety checks in the application.' +) \ No newline at end of file diff --git a/runtime/Sources/Core/meson.build b/runtime/Sources/Core/meson.build new file mode 100644 index 0000000..d5d929f --- /dev/null +++ b/runtime/Sources/Core/meson.build @@ -0,0 +1,14 @@ +sources += [ + files( + 'Application.cpp', + 'Bridge.cpp', + 'EventBus.cpp', + 'EventListener.cpp', + 'Fps.cpp', + 'Graphics.cpp', + 'Logs.cpp', + 'Memory.cpp', + 'Profiler.cpp', + 'SDLManager.cpp', + 'UUID.cpp') +] \ No newline at end of file diff --git a/runtime/Sources/Graphics/meson.build b/runtime/Sources/Graphics/meson.build new file mode 100644 index 0000000..d9b21f3 --- /dev/null +++ b/runtime/Sources/Graphics/meson.build @@ -0,0 +1,10 @@ +sources += [ + files( + 'Font.cpp', + 'Mesh.cpp', + 'PutPixelManager.cpp', + 'Scene.cpp', + 'Sprite.cpp', + 'Text.cpp' + ) +] \ No newline at end of file diff --git a/runtime/Sources/Platform/meson.build b/runtime/Sources/Platform/meson.build new file mode 100644 index 0000000..7c5be15 --- /dev/null +++ b/runtime/Sources/Platform/meson.build @@ -0,0 +1,6 @@ +sources += [ + files( + 'Inputs.cpp', + 'Window.cpp' + ) +] \ No newline at end of file diff --git a/runtime/Sources/Renderer/Pipelines/meson.build b/runtime/Sources/Renderer/Pipelines/meson.build new file mode 100644 index 0000000..5bc6a97 --- /dev/null +++ b/runtime/Sources/Renderer/Pipelines/meson.build @@ -0,0 +1,6 @@ +sources += [ + files( + 'Graphics.cpp', + 'Shader.cpp' + ) +] \ No newline at end of file diff --git a/runtime/Sources/Renderer/RenderPasses/meson.build b/runtime/Sources/Renderer/RenderPasses/meson.build new file mode 100644 index 0000000..90970ef --- /dev/null +++ b/runtime/Sources/Renderer/RenderPasses/meson.build @@ -0,0 +1,7 @@ +sources += [ + files( + '2DPass.cpp', + 'FinalPass.cpp', + 'Passes.cpp' + ) +] diff --git a/runtime/Sources/Renderer/Vulkan/meson.build b/runtime/Sources/Renderer/Vulkan/meson.build new file mode 100644 index 0000000..879de81 --- /dev/null +++ b/runtime/Sources/Renderer/Vulkan/meson.build @@ -0,0 +1,5 @@ +sources += [ + files( + 'VulkanLoader.cpp' + ) +] diff --git a/runtime/Sources/Renderer/meson.build b/runtime/Sources/Renderer/meson.build new file mode 100644 index 0000000..cf11a0b --- /dev/null +++ b/runtime/Sources/Renderer/meson.build @@ -0,0 +1,16 @@ +sources += [ + files( + 'Buffer.cpp', + 'Descriptor.cpp', + 'Image.cpp', + 'Memory.cpp', + 'RenderCore.cpp', + 'Renderer.cpp', + 'SceneRenderer.cpp', + 'Swapchain.cpp' + ) +] + +subdir('Pipelines') +subdir('RenderPasses') +subdir('Vulkan') \ No newline at end of file diff --git a/runtime/Sources/meson.build b/runtime/Sources/meson.build new file mode 100644 index 0000000..6676867 --- /dev/null +++ b/runtime/Sources/meson.build @@ -0,0 +1,5 @@ +sources = [] +subdir('Core') +subdir('Graphics') +subdir('Platform') +subdir('Renderer') \ No newline at end of file