binding.gyp 2.44 KB
Newer Older
Tim Branyen's avatar
Tim Branyen committed
1 2 3 4 5 6
{
  "targets": [
    {
      "target_name": "nodegit",

      "dependencies": [
7
        "vendor/libgit2.gyp:libgit2"
Tim Branyen's avatar
Tim Branyen committed
8 9
      ],

10 11 12
      "variables": {
        "coverage%": 0
      },
Tim Branyen's avatar
Tim Branyen committed
13
      "sources": [
14
        "src/async_baton.cc",
15
        "src/lock_master.cc",
Tim Branyen's avatar
Tim Branyen committed
16
        "src/nodegit.cc",
17
        "src/init_ssh2.cc",
18
        "src/promise_completion.cc",
Tim Branyen's avatar
Tim Branyen committed
19 20
        "src/wrapper.cc",
        "src/functions/copy.cc",
21
        "src/functions/free.cc",
22 23
        "src/convenient_patch.cc",
        "src/convenient_hunk.cc",
24
        "src/filter_registry.cc",
25
        "src/git_buf_converter.cc",
John Haley's avatar
John Haley committed
26
        "src/str_array_converter.cc",
27
        "src/thread_pool.cc",
28
        {% each %}
29
          {% if type != "enum" %}
30
            "src/{{ name }}.cc",
31
          {% endif %}
32
        {% endeach %}
33
      ],
Tim Branyen's avatar
Tim Branyen committed
34 35 36

      "include_dirs": [
        "vendor/libv8-convert",
37
        "vendor/libssh2/include",
Stjepan Rajko's avatar
Stjepan Rajko committed
38
        "vendor/openssl/openssl/include",
Tim Branyen's avatar
Tim Branyen committed
39 40 41 42
        "<!(node -e \"require('nan')\")"
      ],

      "cflags": [
John Haley's avatar
John Haley committed
43
        "-Wall"
Tim Branyen's avatar
Tim Branyen committed
44 45 46
      ],

      "conditions": [
47 48 49 50 51 52 53 54 55 56 57 58 59
        [
          "coverage==1", {
            "cflags": [
              "-ftest-coverage",
              "-fprofile-arcs"
            ],
            "link_settings": {
              "libraries": [
                "-lgcov"
              ]
            },
          }
        ],
Tim Branyen's avatar
Tim Branyen committed
60 61 62 63
        [
          "OS=='mac'", {
            "xcode_settings": {
              "GCC_ENABLE_CPP_EXCEPTIONS": "YES",
John Haley's avatar
John Haley committed
64
              "MACOSX_DEPLOYMENT_TARGET": "10.7",
Tim Branyen's avatar
Tim Branyen committed
65 66 67

              "WARNING_CFLAGS": [
                "-Wno-unused-variable",
68
                "-Wint-conversions",
Stjepan Rajko's avatar
Stjepan Rajko committed
69 70
                "-Wmissing-field-initializers",
                "-Wno-c++11-extensions"
John Haley's avatar
John Haley committed
71
              ]
Tim Branyen's avatar
Tim Branyen committed
72 73
            }
          }
74 75
        ],
        [
John Haley's avatar
John Haley committed
76 77
          "OS=='win'", {
            "defines": [
78
              "_HAS_EXCEPTIONS=1"
79
            ],
80 81 82 83 84
            "msvs_settings": {
              "VCCLCompilerTool": {
                "AdditionalOptions": [
                  "/EHsc"
                ]
85
              },
86 87 88 89
              "VCLinkerTool": {
                "AdditionalOptions": [
                  "/FORCE:MULTIPLE"
                ]
90 91
              }
            }
John Haley's avatar
John Haley committed
92
          }
93 94 95 96 97 98 99 100 101
        ],
        [
          "OS=='linux' or OS=='mac'", {
            "libraries": [
              "-lcurl"
            ]
          }
        ],
        [
102
          "OS=='linux' or OS.endswith('bsd')", {
Stjepan Rajko's avatar
Stjepan Rajko committed
103
            "cflags": [
104
              "-std=c++11"
Stjepan Rajko's avatar
Stjepan Rajko committed
105 106
            ]
          }
Tim Branyen's avatar
Tim Branyen committed
107 108
        ]
      ]
Tim Branyen's avatar
Tim Branyen committed
109
    }
Tim Branyen's avatar
Tim Branyen committed
110 111
  ]
}