From deb40d01fc88d2ea0bb01759380c63906667b433 Mon Sep 17 00:00:00 2001 From: SimonFJ20 Date: Mon, 9 Jan 2023 21:11:06 +0100 Subject: [PATCH] build: source deps instead of static libs --- browser/meson.build | 18 +------------- markup/lexer.cpp | 2 +- markup/lexer.hpp | 2 +- markup/meson.build | 25 ++------------------ meson.build | 46 +++++++++++++++++++++++++++++++++++- scriptlang/lexer.hpp | 2 +- scriptlang/meson.build | 25 ++------------------ server/meson.build | 14 +---------- utils/{utils.hpp => all.hpp} | 0 utils/meson.build | 22 +---------------- 10 files changed, 55 insertions(+), 101 deletions(-) rename utils/{utils.hpp => all.hpp} (100%) diff --git a/browser/meson.build b/browser/meson.build index 87c2ebe..7c593eb 100644 --- a/browser/meson.build +++ b/browser/meson.build @@ -1,20 +1,4 @@ -browser_sources = files( +browser_sources += files( 'main.cpp', ) - -fmt_dep = dependency('fmt') -sdl2_dep = dependency('sdl2') - -executable( - 'web-browser', - browser_sources, - win_subsystem: 'console', - dependencies: [ - fmt_dep, - sdl2_dep, - utils_dep, - markup_dep, - scriptlang_dep, - ], -) diff --git a/markup/lexer.cpp b/markup/lexer.cpp index e889ee1..14bbc95 100644 --- a/markup/lexer.cpp +++ b/markup/lexer.cpp @@ -1,5 +1,5 @@ #include "lexer.hpp" -#include "result.hpp" +#include "utils/all.hpp" #include #include diff --git a/markup/lexer.hpp b/markup/lexer.hpp index ceb171d..fc7e988 100644 --- a/markup/lexer.hpp +++ b/markup/lexer.hpp @@ -1,6 +1,6 @@ #pragma once -#include "utils.hpp" +#include "utils/all.hpp" #include #include diff --git a/markup/meson.build b/markup/meson.build index c822e87..381faef 100644 --- a/markup/meson.build +++ b/markup/meson.build @@ -1,28 +1,7 @@ -markup_sources = files( +markup_sources += files( 'parser.cpp', 'lexer.cpp', ) -markup_inc = include_directories('.') - -fmt_dep = dependency('fmt') - -markup_lib = static_library( - 'web-markup', - markup_sources, - include_directories: [ - markup_inc, - ], - dependencies: [ - fmt_dep, - utils_dep, - ], -) - -markup_dep = declare_dependency( - link_with: markup_lib, - include_directories: [ - markup_inc, - ], -) +# markup_inc = include_directories('.') diff --git a/meson.build b/meson.build index d62c75f..5b358b3 100644 --- a/meson.build +++ b/meson.build @@ -8,8 +8,52 @@ project( ], ) +fmt_dep = dependency('fmt') +sdl2_dep = dependency('sdl2') + + +utils_sources = [] subdir('utils') + +scriptlang_sources = [] subdir('scriptlang') + +markup_sources = [] subdir('markup') -subdir('server') + +common_sources = utils_sources + scriptlang_sources + markup_sources + + +browser_sources = [] + common_sources subdir('browser') +browser_sources + +executable( + 'web-browser', + browser_sources, + win_subsystem: 'console', + include_directories: [ + include_directories('.'), + include_directories('browser'), + ], + dependencies: [ + fmt_dep, + sdl2_dep, + ], +) + +server_sources = [] + common_sources +subdir('server') + +executable( + 'web-server', + server_sources, + win_subsystem: 'console', + include_directories: [ + include_directories('.'), + include_directories('server'), + ], + dependencies: [ + fmt_dep, + ], +) diff --git a/scriptlang/lexer.hpp b/scriptlang/lexer.hpp index b052b63..3422cfd 100644 --- a/scriptlang/lexer.hpp +++ b/scriptlang/lexer.hpp @@ -1,4 +1,4 @@ -#include "utils.hpp" +#include "utils/all.hpp" #include #include diff --git a/scriptlang/meson.build b/scriptlang/meson.build index 6b2d25c..b110ac0 100644 --- a/scriptlang/meson.build +++ b/scriptlang/meson.build @@ -1,28 +1,7 @@ -scriptlang_sources = files( +scriptlang_sources += files( 'parser.cpp', 'lexer.cpp', ) -scriptlang_inc = include_directories('.') - -fmt_dep = dependency('fmt') - -scriptlang_lib = static_library( - 'web-scriptlang', - scriptlang_sources, - include_directories: [ - scriptlang_inc, - ], - dependencies: [ - fmt_dep, - utils_dep, - ], -) - -scriptlang_dep = declare_dependency( - link_with: scriptlang_lib, - include_directories: [ - scriptlang_inc, - ], -) +# scriptlang_inc = include_directories('.') diff --git a/server/meson.build b/server/meson.build index aa8b02f..17a962f 100644 --- a/server/meson.build +++ b/server/meson.build @@ -1,17 +1,5 @@ -server_sources = files( +server_sources += files( 'main.cpp', ) -fmt_dep = dependency('fmt') - -server_exe = executable( - 'web-server', - server_sources, - win_subsystem: 'console', - dependencies: [ - fmt_dep, - utils_dep, - markup_dep, - ], -) diff --git a/utils/utils.hpp b/utils/all.hpp similarity index 100% rename from utils/utils.hpp rename to utils/all.hpp diff --git a/utils/meson.build b/utils/meson.build index 8f2cae1..28f0271 100644 --- a/utils/meson.build +++ b/utils/meson.build @@ -1,24 +1,4 @@ utils_sources = files() -utils_inc = include_directories('.') - -fmt_dep = dependency('fmt') - -utils_lib = static_library( - 'web-utils', - utils_sources, - include_directories: [ - utils_inc, - ], - dependencies: [ - fmt_dep, - ], -) - -utils_dep = declare_dependency( - link_with: utils_lib, - include_directories: [ - utils_inc, - ], -) +# utils_inc = include_directories('.')