build: source deps instead of static libs

This commit is contained in:
SimonFJ20 2023-01-09 21:11:06 +01:00
parent a023474bdb
commit deb40d01fc
10 changed files with 55 additions and 101 deletions

View File

@ -1,20 +1,4 @@
browser_sources = files( browser_sources += files(
'main.cpp', '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,
],
)

View File

@ -1,5 +1,5 @@
#include "lexer.hpp" #include "lexer.hpp"
#include "result.hpp" #include "utils/all.hpp"
#include <cctype> #include <cctype>
#include <string_view> #include <string_view>

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "utils.hpp" #include "utils/all.hpp"
#include <optional> #include <optional>
#include <string_view> #include <string_view>

View File

@ -1,28 +1,7 @@
markup_sources = files( markup_sources += files(
'parser.cpp', 'parser.cpp',
'lexer.cpp', 'lexer.cpp',
) )
markup_inc = include_directories('.') # 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,
],
)

View File

@ -8,8 +8,52 @@ project(
], ],
) )
fmt_dep = dependency('fmt')
sdl2_dep = dependency('sdl2')
utils_sources = []
subdir('utils') subdir('utils')
scriptlang_sources = []
subdir('scriptlang') subdir('scriptlang')
markup_sources = []
subdir('markup') subdir('markup')
subdir('server')
common_sources = utils_sources + scriptlang_sources + markup_sources
browser_sources = [] + common_sources
subdir('browser') 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,
],
)

View File

@ -1,4 +1,4 @@
#include "utils.hpp" #include "utils/all.hpp"
#include <optional> #include <optional>
#include <string_view> #include <string_view>

View File

@ -1,28 +1,7 @@
scriptlang_sources = files( scriptlang_sources += files(
'parser.cpp', 'parser.cpp',
'lexer.cpp', 'lexer.cpp',
) )
scriptlang_inc = include_directories('.') # 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,
],
)

View File

@ -1,17 +1,5 @@
server_sources = files( server_sources += files(
'main.cpp', 'main.cpp',
) )
fmt_dep = dependency('fmt')
server_exe = executable(
'web-server',
server_sources,
win_subsystem: 'console',
dependencies: [
fmt_dep,
utils_dep,
markup_dep,
],
)

View File

@ -1,24 +1,4 @@
utils_sources = files() utils_sources = files()
utils_inc = include_directories('.') # 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,
],
)