本文共 1693 字,大约阅读时间需要 5 分钟。
我正在研究gradle脚本,我试图编译c ++代码,我的结构如下。我试图在下面的机器上编译我的代码,它显示c ++编译器失败,但我没有得到maven的问题can somel
Linux 2.6.32-431.el6.x86_64#1 SMP Sun 11月10日22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU / Linux
└───src
└───main
├───c++
│ ├───headers (headres is having **.h files)
│ └───native (native contains **.cpp files)
└───resources
└───DSresources
└───DSLib
apply plugin: 'cpp'
//-- set the group for publishing
group = 'com.rohit.singh'
/**
* Initializing GAVC settings
*/
def buildProperties = new Properties()
file("version.properties").withInputStream {
stream -> buildProperties.load(stream)
}
//add the jenkins build version to the version
def env = System.getenv()
if (env["BUILD_NUMBER"]) buildProperties.engineBuildVersion += "_${env["BUILD_NUMBER"]}"
version = buildProperties.engineBuildVersion
println "${version}"
//name is set in the settings.gradle file
group = "com.rohit.singh"
version = buildProperties.engineBuildVersion
println "Building ${project.group}:${project.name}:${project.version}"
model {
components {
main(NativeExecutableSpec) {
targetPlatform "x86"
targetPlatform "x64"
sources {
cpp {
source {
srcDir "src/main/c++/native"
}
}
}
}
}
}以下是Maven代码片段
profile>
Linux
Linux
so
org.codehaus.mojo
native-maven-plugin
1.0-alpha-8
true
linux
generic-classic
g++
g++
NativeJNI/../src/main/c++/native
JniSupport.cpp
DiseaseStagingJni.cpp
-fPIC
NativeJNI
-shared -L${basedir}/src/main/resources/DSresources/DSLib -lds64 -Wl,-rpath,${basedir}/src/main/resources/DSresources/DSLib
javah
generate-sources
LinuxNativeJNI
linux
default
${project.build.directory}/custom-javah
${basedir}
DiseaseStagingJniWrapper.h
com.truvenwealth.analyticsengine.common.diseasestaging.DiseaseStagingJniWrapper
javah
转载地址:http://wdcpo.baihongyu.com/