apply plugin: 'c'

model {
    components {
        main(NativeExecutableSpec) {
            binaries.all {
                sources {
                    if (targetPlatform.operatingSystem.windows) {
                        platformWindows(CSourceSet) {
                            source.srcDir "src/main/windows"
                            lib main.sources.c
                        }
                    } else if (targetPlatform.operatingSystem.linux) {
                        platformLinux(CSourceSet) {
                            source.srcDir "src/main/linux"
                            lib main.sources.c
                        }
                    } else if (targetPlatform.operatingSystem.macOsX) {
                        platformMacOSX(CSourceSet) {
                            source.srcDir "src/main/mac"
                            lib main.sources.c
                        }
                    }
                }
            }
        }
    }
}
