mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-01-23 05:52:23 +08:00
🚧 fix meson build
This commit is contained in:
parent
2e1e4fae32
commit
892bc83df7
15
gucc/meson.build
Normal file
15
gucc/meson.build
Normal file
@ -0,0 +1,15 @@
|
||||
gucc_lib = library('gucc',
|
||||
sources : [
|
||||
'src/file_utils.cpp',
|
||||
'src/string_utils.cpp',
|
||||
'src/cpu.cpp',
|
||||
'src/pacmanconf_repo.cpp',
|
||||
'src/initcpio.cpp',
|
||||
],
|
||||
include_directories : [include_directories('src')],
|
||||
dependencies: deps
|
||||
)
|
||||
|
||||
if is_tests_build
|
||||
subdir('tests')
|
||||
endif
|
@ -1,28 +1,15 @@
|
||||
source_path = '../src/'
|
||||
|
||||
test_libreq = shared_library('test_libreq',
|
||||
sources : [
|
||||
source_path + 'file_utils.cpp',
|
||||
source_path + 'cpu.cpp',
|
||||
source_path + 'pacmanconf_repo.cpp',
|
||||
source_path + 'initcpio.cpp',
|
||||
],
|
||||
include_directories : [include_directories(source_path)],
|
||||
dependencies: deps
|
||||
)
|
||||
|
||||
executable(
|
||||
'test-initcpio',
|
||||
files('unit-initcpio.cpp'),
|
||||
dependencies: deps,
|
||||
link_with: [test_libreq],
|
||||
include_directories: [include_directories(source_path)],
|
||||
link_with: [gucc_lib],
|
||||
include_directories: [include_directories('../src')],
|
||||
install: false)
|
||||
|
||||
executable(
|
||||
'test-pacmanconf',
|
||||
files('unit-pacmanconf.cpp'),
|
||||
dependencies: deps,
|
||||
link_with: [test_libreq],
|
||||
include_directories: [include_directories(source_path)],
|
||||
link_with: [gucc_lib],
|
||||
include_directories: [include_directories('../src')],
|
||||
install: false)
|
||||
|
11
meson.build
11
meson.build
@ -11,6 +11,7 @@ project('cachyos-installer', 'cpp',
|
||||
is_debug_build = get_option('buildtype').startswith('debug')
|
||||
is_dev_environment = get_option('devenv')
|
||||
is_tests_build = get_option('build_tests')
|
||||
do_build_static = get_option('build_static')
|
||||
cc = meson.get_compiler('cpp')
|
||||
if cc.get_id() == 'clang'
|
||||
specific_cc_flags = [
|
||||
@ -68,9 +69,6 @@ src_files = files(
|
||||
'src/definitions.hpp',
|
||||
'src/config.cpp', 'src/config.hpp',
|
||||
'src/utils.cpp', 'src/utils.hpp',
|
||||
'src/cpu.cpp', 'src/cpu.hpp',
|
||||
'src/pacmanconf_repo.cpp', 'src/pacmanconf_repo.hpp',
|
||||
'src/initcpio.cpp', 'src/initcpio.hpp',
|
||||
'src/chwd_profiles.cpp', 'src/chwd_profiles.hpp',
|
||||
'src/disk.cpp', 'src/disk.hpp',
|
||||
'src/drivers.cpp', 'src/drivers.hpp',
|
||||
@ -152,7 +150,9 @@ if not is_debug_build
|
||||
endif
|
||||
|
||||
possible_cc_flags += ['-fdata-sections', '-ffunction-sections']
|
||||
if do_build_static
|
||||
possible_link_flags = ['-Wl,--gc-sections', '-static-libgcc', '-static-libstdc++']
|
||||
endif
|
||||
add_project_link_arguments(cc.get_supported_link_arguments(possible_link_flags), language : 'cpp')
|
||||
endif
|
||||
|
||||
@ -163,11 +163,14 @@ if not is_dev_environment
|
||||
deps += [cpr]
|
||||
endif
|
||||
|
||||
subdir('gucc')
|
||||
|
||||
executable(
|
||||
'cachyos-installer',
|
||||
src_files,
|
||||
dependencies: deps,
|
||||
include_directories: [include_directories('src')],
|
||||
link_with: gucc_lib,
|
||||
include_directories: [include_directories('src'), include_directories('gucc/src')],
|
||||
install: true)
|
||||
|
||||
install_data(
|
||||
|
@ -1,2 +1,3 @@
|
||||
option('devenv', type: 'boolean', value: true, description: 'enable dev environment')
|
||||
option('build_tests', type: 'boolean', value: false, description: 'enable tests')
|
||||
option('build_static', type: 'boolean', value: false, description: 'build all static')
|
||||
|
@ -14,8 +14,9 @@ test_libreq = shared_library('test_libreq',
|
||||
source_path + 'simple_tui.cpp',
|
||||
source_path + 'tui.cpp',
|
||||
],
|
||||
include_directories : [include_directories(source_path)],
|
||||
dependencies: deps
|
||||
include_directories : [include_directories(source_path), include_directories('../gucc/src')],
|
||||
dependencies: deps,
|
||||
link_with: [gucc_lib]
|
||||
)
|
||||
|
||||
executable(
|
||||
|
Loading…
Reference in New Issue
Block a user