Skip to content

Instantly share code, notes, and snippets.

@AurelienRibon
Last active August 29, 2015 14:24
Show Gist options
  • Select an option

  • Save AurelienRibon/1fd235c94f4ebcd69122 to your computer and use it in GitHub Desktop.

Select an option

Save AurelienRibon/1fd235c94f4ebcd69122 to your computer and use it in GitHub Desktop.
apply plugin: 'cpp'
apply plugin: 'c'
model {
components {
/**
* Definition of the main executable
*/
main(NativeExecutableSpec) {
sources {
cpp {
source {
srcDir 'src/main'
include '**/*.cpp'
}
}
}
binaries.all {
lib library: 'fossa', linkage: 'static'
if (toolChain in VisualCpp) {
cppCompiler.args '/W4', '/WX' // enable all warnings
cppCompiler.args '/EHsc' // enable exceptions
}
if (toolChain in Clang) {
cppCompiler.args '-std=c++11' // enable c++11
}
}
}
/**
* Definition of the FOSSA library
*/
fossa(NativeLibrarySpec) {
sources {
c {
source {
srcDir 'src/fossa'
include '**/*.c'
}
exportedHeaders {
srcDir 'src/fossa'
}
}
}
binaries.all {
cCompiler.define 'NS_ENABLE_THREADS'
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment