{
   "targets":[
      {
         "target_name":"paperfilter",
         "variables": {
            "no_wpcap": '<!(echo %NO_WPCAP%)'
         },
         "sources":[
            "main.cpp",
            "log_message.cpp",
            "console.cpp",
            "buffer.cpp",
            "large_buffer.cpp",
            "layer.cpp",
            "item.cpp",
            "item_value.cpp",
            "session.cpp",
            "packet.cpp",
            "packet_store.cpp",
            "packet_dispatcher.cpp",
            "filtered_packet_store.cpp",
            "stream_chunk.cpp",
            "paper_context.cpp",
            "dissector.cpp",
            "dissector_thread.cpp",
            "stream_dissector_thread.cpp",
            "filter.cpp",
            "filter_thread.cpp",
            "stream_dispatcher.cpp",
            "vendor/json11/json11.cpp",
            "vendor/v8pp/v8pp/context.cpp"
         ],
         "include_dirs":[
            "<!(node -e \"require('nan')\")",
            "vendor/v8pp",
            "vendor/json11"
         ],
         "cflags!":[
            "-fno-exceptions"
         ],
         "cflags_cc!":[
            "-fno-exceptions",
            "-fno-rtti"
         ],
         "conditions":[
            [
               "OS=='linux'",
               {
                  "sources":[
                     "linux/permission.cpp",
                     "linux/pcap.cpp"
                  ],
                  "include_dirs":[
                     "linux"
                  ],
                  "libraries":[
                     "-Wl,-dn,-lpcap,-lcap,-lrt,-dy,-lpthread,-ldl"
                  ]
               }
            ],
            [
               "OS=='mac'",
               {
                  "sources":[
                     "darwin/permission.cpp",
                     "darwin/pcap.cpp"
                  ],
                  "include_dirs":[
                     "darwin"
                  ],
                  "libraries":[
                     "-L/usr/local/lib",
                     "-lpcap"
                  ],
                  "xcode_settings":{
                     "MACOSX_DEPLOYMENT_TARGET":"10.9",
                     "GCC_ENABLE_CPP_EXCEPTIONS":"YES",
                     "GCC_ENABLE_CPP_RTTI":"YES"
                  }
               }
            ],
            [
               "OS=='win'",
               {
                  "sources":[
                     "win/permission.cpp",
                     "win/pcap.cpp"
                  ],
                  "include_dirs":[
                     "win",
                     "vendor/WpdPack/Include"
                  ],
                  "configurations":{
                     "Release":{
                        "msvs_settings":{
                           "VCLinkerTool":{
                              "AdditionalLibraryDirectories":[
                                 "<(module_root_dir)/vendor/WpdPack/Lib/x64"
                              ]
                           }
                        }
                     }
                  },
                  "defines":[
                     "NOMINMAX"
                  ]
               }
            ],
            [
               "no_wpcap=='true'",
               {
                  "sources!":[
                     "win/pcap.cpp"
                  ],
                  "sources":[
                     "win/pcap_null.cpp"
                  ]
               }
            ]
         ]
      }
   ]
}
