summaryrefslogtreecommitdiff
path: root/src/tools/mdnssd/mdnssd.qbs
blob: 96501952ce994d497f702296c5d4e4ccbdfb4559 (plain)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import qbs.base 1.0
import "../QtcTool.qbs" as QtcTool

QtcTool {
    name: "mdnssd"

    cpp.defines: [ "PID_FILE=\"/tmp/mdnsd.pid\"", "MDNS_UDS_SERVERPATH=\"/tmp/mdnsd\"",
        "MDNS_DEBUGMSGS=0", "HAVE_IPV6" ]
    cpp.includePaths: [ ".",  buildDirectory ]

    Depends { name: "cpp" }
    Depends { name: "Qt"; submodules: ['network' ] }

    files: [
        "uds_daemon.c", "uds_daemon.h",
        "uDNS.c", "uDNS.h",
        "mDNSDebug.c", "mDNSDebug.h",
        "GenLinkedList.c", "GenLinkedList.h",
        "dnssd_ipc.c", "dnssd_ipc.h",
        "DNSDigest.c",
        "DNSCommon.c",
        "mDNSUNP.h",
        "mDNSEmbeddedAPI.h",
        "DNSCommon.h",
        "DebugServices.h",
        "dns_sd.h",
        "mDNS.c",
    ]

    Group {
        condition: qbs.targetOS === "linux"
        files: [
            "mDNSPosix.c",  "mDNSPosix.h",
            "PlatformCommon.c", "PlatformCommon.h",
            "PosixDaemon.c",
            "mDNSUNP.c"
        ]
    }

    Properties {
        condition: qbs.targetOS === "linux"
        cpp.defines: [ "_GNU_SOURCE", , "NOT_HAVE_SA_LEN", "USES_NETLINK", "HAVE_LINUX",
            "TARGET_OS_LINUX" ]
    }

    Properties {
        condition: qbs.targetOS === "macx"
        cpp.defines: [ "__MAC_OS_X_VERSION_MIN_REQUIRED=__MAC_OS_X_VERSION_10_4",
            "__APPLE_USE_RFC_2292" ]
    }

    Group {
        condition: qbs.targetOS === "windows"
        files: [
            "Firewall.h", "Firewall.cpp",
            "mDNSWin32.h", "mDNSWin32.c",
            "Poll.h", "Poll.c",
            "Secret.h", "Secret.c",
            "Service.h", "Service.c",
            "DebugServices.c",
            "LegacyNATTraversal.c",
            "resource.h",
            "RegNames.h",
            "CommonServices.h",
            "main.c",
            "EventLog.mc",
            "Service.rc"
        ]
    }

    Properties {
        condition: qbs.targetOS === "windows"
        cpp.defines: [ "_WIN32_WINNT=0x0501", "NDEBUG", "MDNS_DEBUGMSGS=0", "TARGET_OS_WIN32",
            "WIN32_LEAN_AND_MEAN", "USE_TCP_LOOPBACK", "PLATFORM_NO_STRSEP",
            "PLATFORM_NO_EPIPE", "PLATFORM_NO_RLIMIT", "UNICODE", "_UNICODE",
            "_CRT_SECURE_NO_DEPRECATE", "_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1",
            "_LEGACY_NAT_TRAVERSAL_" ]
        cpp.dynamicLibraries: [ "ws2_32.lib", "advapi32.lib", "ole32.lib", "oleaut32.lib",
            "iphlpapi.lib", "netapi32.lib", "user32.lib", "powrprof.lib", "shell32.lib" ]
    }

    Properties {
        condition: qbs.toolchain === 'mingw' || qbs.toolchain === 'gcc'
        cpp.cFlags: [ "-Wno-unused-but-set-variable", "-Wno-strict-aliasing" ]
        cpp.cxxFlags: [ "-Wno-unused-but-set-variable" ]
    }

    FileTagger {
        pattern: "*.mc"
        fileTags: "mc"
    }

    Rule {
        inputs: "mc"
        Artifact {
            fileName: input.baseName + ".h"
            fileTags: "hpp"
        }

        prepare: {
            var cmd = new Command("mc", input.fileName)
            cmd.description = "mc"
            return cmd
        }
    }
}