File: test.gyp

package info (click to toggle)
firefox-esr 128.14.0esr-1~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,230,248 kB
  • sloc: cpp: 7,104,262; javascript: 6,088,450; ansic: 3,654,017; python: 1,212,326; xml: 594,604; asm: 420,654; java: 182,969; sh: 71,124; makefile: 20,739; perl: 13,449; objc: 12,399; yacc: 4,583; cs: 3,846; pascal: 2,973; lex: 1,720; ruby: 1,194; exp: 762; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10
file content (68 lines) | stat: -rw-r--r-- 2,307 bytes parent folder | download | duplicates (52)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

{
  'targets': [
    {
      # This creates a static library and puts it in a nonstandard location for
      # libraries-search-path-test.
      'target_name': 'mylib',
      'type': 'static_library',
      'standalone_static_library': 1,
      # This directory is NOT in the default library search locations. It also
      # MUST be passed in on the gyp command line:
      #
      #  -D abs_path_to_secret_library_location=/some_absolute_path
      #
      # The gyptest itself (../gyptest-library-dirs.py) provides this.
      'product_dir': '<(abs_path_to_secret_library_location)',
      'sources': [
        'mylib.cc',
      ],
    },
    {
      'target_name': 'libraries-search-path-test',
      'type': 'executable',
      'dependencies': [
        # It is important to NOT list the mylib as a dependency here, because
        # some build systems will track it down based on its product_dir,
        # such that the link succeeds even without the library_dirs below.
        #
        # The point of this weird structuring is to ensure that 'library_dirs'
        # works as advertised, such that just '-lmylib' (or its equivalent)
        # works based on the directories that library_dirs puts in the library
        # link path.
        #
        # If 'mylib' was listed as a proper dependency here, the build system
        # would find it and link with its path on disk.
        #
        # Note that this implies 'mylib' must already be built when building
        # 'libraries-search-path-test' (see ../gyptest-library-dirs.py).
        #
        #'mylib',
      ],
      'sources': [
        'hello.cc',
      ],
      # Note that without this, the mylib library would not be found and
      # successfully linked.
      'library_dirs': [
        '<(abs_path_to_secret_library_location)',
      ],
      'link_settings': {
        'conditions': [
          ['OS=="linux"', {
            'libraries': [
              '-lmylib',
            ],
          }, { # else
            'libraries': [
              '<(STATIC_LIB_PREFIX)mylib<(STATIC_LIB_SUFFIX)',
            ],
          }],
        ],  # conditions
      },
    },
  ],
}