model { components { Util(NativeLibrarySpec) { m -> sources { rc { source { srcDir '..' include 'DLLVersion.rc' } } c { source { srcDir 'src' include '**/*.c' } exportedHeaders { srcDir 'include' } } cpp { source { srcDir 'src' include '**/*.cpp' exclude '**/Win*.cpp' } exportedHeaders { srcDir 'include' } lib project: ':Foundation', library: 'Foundation' lib project: ':XML', library: 'XML' lib project: ':JSON', library: 'JSON' } } binaries.all { if (targetPlatform.operatingSystem.windows) { sources { platformWindows(CppSourceSet) { lib m.sources.cpp source { srcDir 'src' include '**/Win*.cpp' } lib project: ':Foundation', library: 'Foundation' lib project: ':XML', library: 'XML' lib project: ':JSON', library: 'JSON' } } } } } } binaries { withType(SharedLibraryBinarySpec) { if (toolChain in VisualCpp) { cppCompiler.define "Util_EXPORTS" } } } } task poco { dependsOn "assemble" }