Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Build with Meson #3073

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contrib/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
plugin = shared_library('plugin', 'plugin.cpp', dependencies: [sass_dep])
7 changes: 7 additions & 0 deletions include/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sass_inc = include_directories('.')
version_h = configure_file(input: 'sass/version.h.in', output: 'version.h',
configuration: {'PACKAGE_VERSION': meson.version()}
)

install_subdir('sass', install_dir: get_option('includedir'), exclude_files: ['version.h', 'version.h.in'])
install_headers('sass.h', 'sass2scss.h', version_h, subdir: 'sass')
14 changes: 14 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
project('libsass', 'c', 'cpp', version: '3.6.4', meson_version: '>=0.49', default_options: ['c_std=c11','cpp_std=c++11'])
cpp = meson.get_compiler('cpp')
if target_machine.system() == 'windows'
add_project_arguments('-D_WIN32', cpp.get_supported_arguments('-Wno-non-virtual-dtor'), language: 'cpp')
endif

deps = [
meson.get_compiler('cpp').find_library('dl', required: false)
]

subdir('res') # Must be before src as src_res is declared here and used there
subdir('include')
subdir('src')
subdir('contrib')
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
option('SASS_CUSTOM_ALLOCATOR', type: 'boolean', value: false, description: 'Activate a custom allocator for performance improvements')
6 changes: 6 additions & 0 deletions res/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
winres_path = files('resource.rc')
src_res = []

if host_machine.system() == 'windows'
src_res += [import('windows').compile_resources(winres_path)]
endif
9 changes: 9 additions & 0 deletions src/memory/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
src_memory = files(
'allocator.cpp',
'shared_ptr.cpp'
)
memory_lib_args = []
if get_option('SASS_CUSTOM_ALLOCATOR')
memory_lib_args += ['-DSASS_CUSTOM_ALLOCATOR']
endif
memory_lib = static_library('memory', src_memory, include_directories: sass_inc, cpp_args: memory_lib_args)
85 changes: 85 additions & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
src_cpp = files(
'ast.cpp',
'ast2c.cpp',
'ast_fwd_decl.cpp',
'ast_sel_cmp.cpp',
'ast_sel_super.cpp',
'ast_sel_unify.cpp',
'ast_sel_weave.cpp',
'ast_selectors.cpp',
'ast_supports.cpp',
'ast_values.cpp',
'backtrace.cpp',
'base64vlq.cpp',
'bind.cpp',
'c2ast.cpp',
'check_nesting.cpp',
'color_maps.cpp',
'constants.cpp',
'context.cpp',
'cssize.cpp',
'emitter.cpp',
'environment.cpp',
'error_handling.cpp',
'eval.cpp',
'eval_selectors.cpp',
'expand.cpp',
'extender.cpp',
'extension.cpp',
'file.cpp',
'fn_colors.cpp',
'fn_lists.cpp',
'fn_maps.cpp',
'fn_miscs.cpp',
'fn_numbers.cpp',
'fn_selectors.cpp',
'fn_strings.cpp',
'fn_utils.cpp',
'inspect.cpp',
'json.cpp',
'lexer.cpp',
'listize.cpp',
'operators.cpp',
'output.cpp',
'parser.cpp',
'parser_selectors.cpp',
'plugins.cpp',
'position.cpp',
'prelexer.cpp',
'remove_placeholders.cpp',
'sass.cpp',
'sass2scss.cpp',
'sass_context.cpp',
'sass_functions.cpp',
'sass_values.cpp',
'source.cpp',
'source_map.cpp',
'stylesheet.cpp',
'to_value.cpp',
'units.cpp',
'utf8_string.cpp',
'util.cpp',
'util_string.cpp',
'values.cpp'
)
src_c = files(
'c99func.c',
'cencode.c'
)
mgreter marked this conversation as resolved.
Show resolved Hide resolved

subdir('memory')

sass_lib = library('sass', src_cpp, src_c, src_res,
include_directories: sass_inc,
dependencies: deps,
c_args: ['-DADD_EXPORTS'],
cpp_args: ['-DADD_EXPORTS'],
install: true
)

sass_dep = declare_dependency(link_with: sass_lib, include_directories: sass_inc)

import('pkgconfig').generate(
sass_lib,
description: 'A C implementation of a Sass compiler'
)
Empty file added src/support/meson.build
Empty file.