Last active
August 29, 2015 14:27
-
-
Save nodakai/b612a7f58c840cda0fb0 to your computer and use it in GitHub Desktop.
Minimal Gradle C++ project with multiple references to external libraries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'cpp' | |
model { | |
components { | |
main(NativeExecutableSpec) { | |
sources { | |
cpp { | |
source { | |
srcDirs '.' | |
include 'foo.cpp' | |
} | |
} | |
} | |
binaries { | |
all { | |
lib library: 'm' | |
lib library: 'rt' | |
} | |
} | |
} | |
} | |
repositories { | |
libs(PrebuiltLibraries) { | |
m { | |
binaries.withType(SharedLibraryBinary) { | |
sharedLibraryFile = file("/usr/lib64/libm.so") | |
} | |
} | |
rt { | |
binaries.withType(SharedLibraryBinary) { | |
sharedLibraryFile = file("/usr/lib64/librt.so") | |
} | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main() { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment