tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

meson.build (4563B)


      1 # Copyright © 2018 Intel Corporation
      2 
      3 # Permission is hereby granted, free of charge, to any person obtaining a copy
      4 # of this software and associated documentation files (the "Software"), to deal
      5 # in the Software without restriction, including without limitation the rights
      6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
      7 # copies of the Software, and to permit persons to whom the Software is
      8 # furnished to do so, subject to the following conditions:
      9 
     10 # The above copyright notice and this permission notice shall be included in
     11 # all copies or substantial portions of the Software.
     12 
     13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
     18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
     19 # SOFTWARE.
     20 
     21 config_h = configure_file(
     22  configuration : config,
     23  output : 'pixman-config.h'
     24 )
     25 
     26 version_h = configure_file(
     27  configuration : version_conf,
     28  input : 'pixman-version.h.in',
     29  output : 'pixman-version.h',
     30  install_dir : get_option('prefix') / get_option('includedir') / 'pixman-1'
     31 )
     32 
     33 libpixman_extra_cargs = []
     34 default_library = get_option('default_library')
     35 if default_library != 'static' and cc.has_function_attribute('dllexport')
     36  libpixman_extra_cargs = ['-DPIXMAN_API=__declspec(dllexport)']
     37 endif
     38 
     39 pixman_simd_libs = []
     40 simds = [
     41  # the mmx library can be compiled with mmx on x86/x86_64 or loongson
     42  # mmi on loongson mips systems. The libraries will all have the same
     43  # name, "pixman-mmx", but there is no chance of more than one version
     44  # being built in the same build because no system could have mmx and
     45  # mmi, and it simplifies the build logic to give them the same name.
     46  ['mmx', have_mmx, mmx_flags, []],
     47  ['mmx', have_loongson_mmi, loongson_mmi_flags, []],
     48 
     49  ['sse2', have_sse2, sse2_flags, []],
     50  ['ssse3', have_ssse3, ssse3_flags, []],
     51  ['vmx', have_vmx, vmx_flags, []],
     52  ['arm-simd', have_armv6_simd, [],
     53   ['pixman-arm-simd-asm.S', 'pixman-arm-simd-asm-scaled.S']],
     54  ['arm-neon', have_neon, [],
     55   ['pixman-arm-neon-asm.S', 'pixman-arm-neon-asm-bilinear.S']],
     56  ['arm-neon', have_a64neon, [],
     57   ['pixman-arma64-neon-asm.S', 'pixman-arma64-neon-asm-bilinear.S']],
     58  ['mips-dspr2', have_mips_dspr2, mips_dspr2_flags,
     59   ['pixman-mips-dspr2-asm.S', 'pixman-mips-memcpy-asm.S']],
     60   ['rvv', have_rvv, rvv_flags, []],
     61 ]
     62 
     63 foreach simd : simds
     64  if simd[1]
     65    name = 'pixman-' + simd[0]
     66    pixman_simd_libs += static_library(
     67      name,
     68      [name + '.c', config_h, version_h, simd[3]],
     69      c_args : simd[2]
     70    )
     71  endif
     72 endforeach
     73 
     74 pixman_files = files(
     75  'pixman.c',
     76  'pixman-access.c',
     77  'pixman-access-accessors.c',
     78  'pixman-arm.c',
     79  'pixman-bits-image.c',
     80  'pixman-combine32.c',
     81  'pixman-combine-float.c',
     82  'pixman-conical-gradient.c',
     83  'pixman-edge.c',
     84  'pixman-edge-accessors.c',
     85  'pixman-fast-path.c',
     86  'pixman-filter.c',
     87  'pixman-glyph.c',
     88  'pixman-general.c',
     89  'pixman-gradient-walker.c',
     90  'pixman-image.c',
     91  'pixman-implementation.c',
     92  'pixman-linear-gradient.c',
     93  'pixman-matrix.c',
     94  'pixman-mips.c',
     95  'pixman-noop.c',
     96  'pixman-ppc.c',
     97  'pixman-radial-gradient.c',
     98  'pixman-region16.c',
     99  'pixman-region32.c',
    100  'pixman-region64f.c',
    101  'pixman-riscv.c',
    102  'pixman-solid-fill.c',
    103  'pixman-timer.c',
    104  'pixman-trap.c',
    105  'pixman-utils.c',
    106  'pixman-x86.c',
    107 )
    108 
    109 # Android cpu-features
    110 cpu_features_path = get_option('cpu-features-path')
    111 cpu_features_sources = []
    112 cpu_features_inc = []
    113 if cpu_features_path != ''
    114  message('Using cpu-features.[ch] from ' + cpu_features_path)
    115  cpu_features_sources = files(
    116    cpu_features_path / 'cpu-features.h',
    117    cpu_features_path / 'cpu-features.c',
    118  )
    119  cpu_features_inc = include_directories(cpu_features_path)
    120 endif
    121 
    122 libpixman = library(
    123  'pixman-1',
    124  [pixman_files, config_h, version_h, cpu_features_sources],
    125  link_with: pixman_simd_libs,
    126  c_args : libpixman_extra_cargs,
    127  dependencies : [dep_m, dep_threads],
    128  include_directories : cpu_features_inc,
    129  version : meson.project_version(),
    130  install : true,
    131 )
    132 
    133 inc_pixman = include_directories('.')
    134 
    135 idep_pixman = declare_dependency(
    136  link_with: libpixman,
    137  include_directories : inc_pixman,
    138 )
    139 meson.override_dependency('pixman-1', idep_pixman)
    140 
    141 install_headers('pixman.h', subdir : 'pixman-1')