Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update compiler flags #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sourceCompatibility = 1.8
targetCompatibility = 1.8

test {
systemProperty "java.library.path", file("${buildDir}/libs/hello/shared").absolutePath
systemProperty "java.library.path", file("${buildDir}/libs/borracha3/shared").absolutePath
}

model {
Expand All @@ -26,13 +26,14 @@ model {
}

components {
hello(NativeLibrarySpec) {
borracha3(NativeLibrarySpec) {
binaries.all {
if (targetPlatform.operatingSystem.macOsX) {
cCompiler.args '-I', "${org.gradle.internal.jvm.Jvm.current().javaHome}/include"
cCompiler.args '-I', "${org.gradle.internal.jvm.Jvm.current().javaHome}/include/darwin"
cCompiler.args '-mmacosx-version-min=10.4'
linker.args '-mmacosx-version-min=10.4'
cCompiler.args '-mmacosx-version-min=10.9'
cCompiler.args '-stdlib=libc++'
linker.args '-mmacosx-version-min=10.9'
} else if (targetPlatform.operatingSystem.linux) {
cCompiler.args '-I', "${org.gradle.internal.jvm.Jvm.current().javaHome}/include"
cCompiler.args '-I', "${org.gradle.internal.jvm.Jvm.current().javaHome}/include/linux"
Expand All @@ -50,4 +51,4 @@ model {
}
}

test.dependsOn 'helloSharedLibrary'
test.dependsOn 'borracha3SharedLibrary'
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip
File renamed without changes.
2 changes: 1 addition & 1 deletion src/main/java/HelloWorld.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ class HelloWorld {
public native void print();

static {
System.loadLibrary("hello");
System.loadLibrary("borracha3");
}
}