| Index: meson.build |
| =================================================================== |
| new file mode 100644 |
| --- /dev/null |
| +++ b/meson.build |
| @@ -0,0 +1,90 @@ |
| +project('libadblockplus', 'cpp', default_options : ['cpp_std=c++14']) |
| + |
| +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/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') |
| +endif |
| + |
| +GYP_PARAMETERS=[ '-D', 'host_arch=x86_64', '-D', 'OS=mac', |
| + '-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@' ]) |
| + |
| +v8 = custom_target('v8', input: build_v8, |
| + output: [ 'libv8_base.a', 'libv8_libbase.a' ], |
| + command: [ 'make', '-C', 'v8', 'v8_base' ]) |
| +v8_libplatform = custom_target('v8_libplatform', |
| + input: [ build_v8, v8 ], output: 'libv8_libplatform.a', |
| + command: [ 'make', '-C', 'v8', 'v8_libplatform' ]) |
| +v8_libsampler = custom_target('v8_libsampler', |
| + input: [ build_v8, v8_libplatform ], output: 'libv8_libsampler.a', |
| + command: [ 'make', '-C', 'v8', 'v8_libsampler' ]) |
| +v8_snapshot = custom_target('v8_snapshot', |
| + input: [ build_v8, v8_libsampler ], output: 'libv8_snapshot.a', |
| + command: [ 'make', '-C', 'v8', 'v8_snapshot' ]) |
| + |
| +adblockplus = shared_library('adblockplus', sources, |
| + v8_snapshot, v8_libplatform, |
| + v8_libsampler, include_directories: incdir, |
| + dependencies: [ have_curl ]) |
| + |
| +test_sources = files( |
| + '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' |
| +) |
| + |
| +#gtest = dependency('gtest', main: true, required: false) |
| + |
| +#executable('tests', test_sources, adblockplus, include_directories: incdir, dependencies: gtest) |