| Index: meson.build | 
| =================================================================== | 
| new file mode 100644 | 
| --- /dev/null | 
| +++ b/meson.build | 
| @@ -0,0 +1,172 @@ | 
| +project('libadblockplus', 'cpp', default_options : ['cpp_std=c++14'], meson_version: '>0.40.0') | 
| + | 
| +V8_DIR='third_party/v8' | 
| +V8_GYP=meson.source_root() + '/third_party/gyp/gyp' | 
| + | 
| +have_curl = dependency('curl', required: false) | 
| +incdir = include_directories('include', V8_DIR + '/include') | 
| + | 
| +ensure_dependencies = run_target('ensure_dependencies', | 
| + command: ['python', 'ensure_dependencies.py']) | 
| + | 
| +sources = files( | 
| + 'include/AdblockPlus/ITimer.h', | 
| + 'include/AdblockPlus/IWebRequest.h', | 
| + 'include/AdblockPlus/IFileSystem.h', | 
| + 'include/AdblockPlus/Scheduler.h', | 
| + 'include/AdblockPlus/Platform.h', | 
| + 'src/ActiveObject.cpp', | 
| + 'src/AsyncExecutor.cpp', | 
| + 'src/AppInfoJsObject.cpp', | 
| + 'src/ConsoleJsObject.cpp', | 
| + 'src/DefaultLogSystem.cpp', | 
| + 'src/DefaultFileSystem.h', | 
| + 'src/DefaultFileSystem.cpp', | 
| + 'src/DefaultTimer.cpp', | 
| + 'src/DefaultTimer.h', | 
| + 'src/DefaultWebRequest.h', | 
| + 'src/DefaultWebRequest.cpp', | 
| + 'src/FileSystemJsObject.cpp', | 
| + 'src/FilterEngine.cpp', | 
| + 'src/GlobalJsObject.cpp', | 
| + 'src/JsContext.cpp', | 
| + 'src/JsEngine.cpp', | 
| + 'src/JsError.cpp', | 
| + 'src/JsValue.cpp', | 
| + 'src/Notification.cpp', | 
| + 'src/Platform.cpp', | 
| + 'src/ReferrerMapping.cpp', | 
| + 'src/Thread.cpp', | 
| + 'src/Utils.cpp', | 
| + 'src/WebRequestJsObject.cpp', | 
| +) | 
| + | 
| +if have_curl.found() == 1 | 
| + sources += files('src/DefaultWebRequestCurl.cpp') | 
| +else | 
| + sources += files('src/DefaultWebRequestDummy.cpp') | 
| +endif | 
| + | 
| +os=target_machine.system() | 
| +if os == 'darwin' | 
| + os = 'mac' | 
| +endif | 
| +GYP_PARAMETERS=[ '-D', 'host_arch=x86_64', '-D', 'OS=' + os, | 
| + '-D', 'target_arch=x86_64' ] | 
| + | 
| +build_v8 = custom_target('build_v8', input: files('build-v8.gypi', V8_DIR + '/src/v8.gyp'), output: 'Makefile', | 
| + command: [ V8_GYP, GYP_PARAMETERS, '--depth=.', '-f', 'make', '-I', '@INPUT0@', '--generator-output=v8', '@INPUT1@' ]) | 
| + | 
| +OUT_DIR=join_paths(meson.build_root(), 'v8', 'out', 'Debug') | 
| + | 
| +WRAP_MAKE=join_paths(meson.source_root(), 'wrap_make') | 
| + | 
| +v8 = custom_target('v8', input: build_v8, | 
| + output: [ 'libv8_base.a', 'libv8_libbase.a' ], | 
| + command: [ WRAP_MAKE, '@OUTPUT@', '-C', 'v8', 'v8_base' ]) | 
| +v8_libplatform = custom_target('v8_libplatform', | 
| + input: [ build_v8, v8 ], output: 'libv8_libplatform.a', | 
| + command: [ WRAP_MAKE, '@OUTPUT@', '-C', 'v8', 'v8_libplatform' ]) | 
| +v8_libsampler = custom_target('v8_libsampler', | 
| + input: [ build_v8, v8_libplatform ], output: 'libv8_libsampler.a', | 
| + command: [ WRAP_MAKE, '@OUTPUT@', '-C', 'v8', 'v8_libsampler' ]) | 
| +v8_snapshot = custom_target('v8_snapshot', | 
| + input: [ build_v8, v8_libsampler ], output: 'libv8_snapshot.a', | 
| + command: [ WRAP_MAKE, '@OUTPUT@', '-C', 'v8', 'v8_snapshot' ]) | 
| + | 
| + | 
| +library_files = files( | 
| + 'lib/info.js', | 
| + 'lib/io.js', | 
| + 'lib/prefs.js', | 
| + 'lib/utils.js', | 
| + 'lib/elemHideHitRegistration.js', | 
| + 'adblockpluscore/lib/events.js', | 
| + 'adblockpluscore/lib/coreUtils.js', | 
| + 'adblockpluscore/lib/filterNotifier.js', | 
| + 'lib/init.js', | 
| + 'adblockpluscore/lib/common.js', | 
| + 'adblockpluscore/lib/filterClasses.js', | 
| + 'adblockpluscore/lib/subscriptionClasses.js', | 
| + 'adblockpluscore/lib/filterStorage.js', | 
| + 'adblockpluscore/lib/elemHide.js', | 
| + 'adblockpluscore/lib/elemHideEmulation.js', | 
| + 'adblockpluscore/lib/matcher.js', | 
| + 'adblockpluscore/lib/filterListener.js', | 
| + 'adblockpluscore/lib/downloader.js', | 
| + 'adblockpluscore/lib/notification.js', | 
| + 'lib/notificationShowRegistration.js', | 
| + 'adblockpluscore/lib/synchronizer.js', | 
| + 'lib/filterUpdateRegistration.js', | 
| + 'adblockpluscore/chrome/content/ui/subscriptions.xml', | 
| + 'lib/updater.js' | 
| +) | 
| +load_before_files = files('lib/compat.js') | 
| +load_after_files = files( | 
| + 'lib/api.js', | 
| + 'lib/publicSuffixList.js', | 
| + 'lib/punycode.js', | 
| + 'lib/basedomain.js' | 
| +) | 
| + | 
| +js_sources = custom_target('js_sources', | 
| + input: load_before_files + load_after_files + library_files, | 
| + output: 'adblockplus.js.cpp', | 
| + command: [ 'python', join_paths(meson.source_root(), 'convert_js.py'), | 
| + '@OUTPUT@', | 
| + '--before', load_before_files, | 
| + '--convert', library_files, | 
| + '--after', load_after_files ]) | 
| + | 
| +adblockplus = shared_library('adblockplus', sources, js_sources, | 
| + v8, v8_libplatform, | 
| + v8_libsampler, v8_snapshot, | 
| + include_directories: incdir, | 
| + dependencies: [ have_curl ]) | 
| + | 
| +test_sources = files( | 
| + 'test/AsyncExecutor.cpp', | 
| + 'test/BaseJsTest.h', | 
| + 'test/BaseJsTest.cpp', | 
| + 'test/AppInfoJsObject.cpp', | 
| + 'test/ConsoleJsObject.cpp', | 
| + 'test/DefaultFileSystem.cpp', | 
| + 'test/FileSystemJsObject.cpp', | 
| + 'test/FilterEngine.cpp', | 
| + 'test/GlobalJsObject.cpp', | 
| + 'test/JsEngine.cpp', | 
| + 'test/JsValue.cpp', | 
| + 'test/Notification.cpp', | 
| + 'test/Prefs.cpp', | 
| + 'test/ReferrerMapping.cpp', | 
| + 'test/UpdateCheck.cpp', | 
| + 'test/WebRequest.cpp', | 
| + 'third_party/googletest/googletest/src/gtest_main.cc' | 
| +) | 
| + | 
| +GTEST_DIR = join_paths('third_party', 'googletest', 'googletest') | 
| +GTEST_PARAMS = [] | 
| +LINK_PARAMS = [] | 
| +compiler = meson.get_compiler('cpp') | 
| +if compiler.has_argument('-pthread') | 
| + GTEST_PARAMS += '-pthread' | 
| + LINK_PARAMS += '-lpthread' | 
| +endif | 
| + | 
| +gtest = static_library('gtest', | 
| + files(join_paths(GTEST_DIR, 'src', 'gtest-all.cc')), | 
| + include_directories: [ | 
| + include_directories(join_paths(GTEST_DIR, 'include'), is_system: true), | 
| + include_directories(GTEST_DIR) | 
| + ], | 
| + cpp_args: GTEST_PARAMS) | 
| + | 
| +tests = executable('tests', test_sources, | 
| + link_with: [adblockplus, gtest], | 
| + link_args: LINK_PARAMS, | 
| + include_directories: [ | 
| + incdir, | 
| + include_directories(join_paths(GTEST_DIR, 'include')) | 
| + ]) | 
| + | 
| +test('tests', tests) |