| OLD | NEW |
| 1 project('adblockpluscore', 'cpp', license: ['GPL3'], meson_version: '>0.40.0') | 1 project('adblockpluscore', 'cpp', license: ['GPL3'], meson_version: '>0.40.0') |
| 2 | 2 |
| 3 native = get_option('native') | 3 native = get_option('native') |
| 4 if native | 4 if native |
| 5 target_type='native' | 5 target_type='native' |
| 6 else | 6 else |
| 7 target_type='js' | 7 target_type='js' |
| 8 endif | 8 endif |
| 9 asan = get_option('asan') | 9 asan = get_option('asan') |
| 10 | 10 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 input: core_objects + shared_objects, | 208 input: core_objects + shared_objects, |
| 209 output: COMPILER_OUTPUT, | 209 output: COMPILER_OUTPUT, |
| 210 depend_files: [ JS_LIBRARY ], | 210 depend_files: [ JS_LIBRARY ], |
| 211 command: [ | 211 command: [ |
| 212 emcc, '-o', output_file, | 212 emcc, '-o', output_file, |
| 213 '--post-js', bindings_output, | 213 '--post-js', bindings_output, |
| 214 '--js-library', JS_LIBRARY, | 214 '--js-library', JS_LIBRARY, |
| 215 '@INPUT@' | 215 '@INPUT@' |
| 216 ] + compiler_args + optional_args) | 216 ] + compiler_args + optional_args) |
| 217 else | 217 else |
| 218 compiler_args = ADDITIONAL_PARAMS + CORE_PARAMS | 218 compiler_args = ADDITIONAL_PARAMS + CORE_PARAMS + optional_args |
| 219 GTEST_DIR = join_paths('third_party', 'googletest', 'googletest') | 219 GTEST_DIR = join_paths('third_party', 'googletest', 'googletest') |
| 220 GTEST_PARAMS = [] | 220 GTEST_PARAMS = [] |
| 221 compiler = meson.get_compiler('cpp') | 221 compiler = meson.get_compiler('cpp') |
| 222 if compiler.has_argument('-pthread') | 222 if compiler.has_argument('-pthread') |
| 223 GTEST_PARAMS += '-pthread' | 223 GTEST_PARAMS += '-pthread' |
| 224 LINK_PARAMS += '-lpthread' | 224 LINK_PARAMS += '-lpthread' |
| 225 endif | 225 endif |
| 226 | 226 |
| 227 test_sources = [ | 227 test_sources = [ |
| 228 'test/compiled/library.cpp', |
| 228 'test/compiled/abptest.cpp', | 229 'test/compiled/abptest.cpp', |
| 229 'test/compiled/String.cpp', | 230 'test/compiled/String.cpp', |
| 230 'test/compiled/StringMap.cpp', | 231 'test/compiled/StringMap.cpp', |
| 231 'test/compiled/RegExp.cpp', | 232 'test/compiled/RegExp.cpp', |
| 232 'test/compiled/Filter.cpp', | 233 'test/compiled/Filter.cpp', |
| 233 ] | 234 ] |
| 234 | 235 |
| 235 adblockpluscore = static_library('adblockpluscore', shared_sources, | 236 adblockpluscore = static_library('adblockpluscore', shared_sources, |
| 236 native_sources, | 237 native_sources, |
| 237 cpp_args: compiler_args, | 238 cpp_args: compiler_args, |
| 238 link_args: LINK_PARAMS, | 239 link_args: LINK_PARAMS, |
| 239 pic: true) | 240 pic: true) |
| 240 gtest = static_library('gtest', files(join_paths(GTEST_DIR, 'src', 'gtest-all.
cc')), | 241 gtest = static_library('gtest', files(join_paths(GTEST_DIR, 'src', 'gtest-all.
cc')), |
| 241 include_directories: [ | 242 include_directories: [ |
| 242 include_directories(join_paths(GTEST_DIR, 'include'
), is_system: true), | 243 include_directories(join_paths(GTEST_DIR, 'include'
), is_system: true), |
| 243 include_directories(GTEST_DIR) | 244 include_directories(GTEST_DIR) |
| 244 ], | 245 ], |
| 245 cpp_args: GTEST_PARAMS) | 246 cpp_args: GTEST_PARAMS) |
| 246 abptest = executable('abptest', test_sources, | 247 abptest = executable('abptest', test_sources, |
| 247 cpp_args: compiler_args + ['-DINSIDE_TESTS'], | 248 cpp_args: compiler_args + ['-DINSIDE_TESTS'], |
| 248 include_directories: include_directories(join_paths(GTEST
_DIR, 'include')), | 249 include_directories: include_directories(join_paths(GTEST
_DIR, 'include')), |
| 249 link_args: LINK_PARAMS, | 250 link_args: LINK_PARAMS, |
| 250 link_with: [ adblockpluscore, gtest ]) | 251 link_with: [ adblockpluscore, gtest ]) |
| 251 test('abptest', abptest) | 252 test('abptest', abptest) |
| 252 endif | 253 endif |
| 253 | 254 |
| OLD | NEW |