I am trying to use ‘cpp-library’ plugin to build application using Gradle 4.7. by default it tries to build 64 bit dlls. I want to build 32 bit dlls.
I am attaching build.gradle file used.
/*
- This file was generated by the Gradle ‘init’ task.
- This is a general purpose Gradle build.
- Learn how to create Gradle builds at https://guides.gradle.org/creating-new-gradle-builds/
*/
import org.gradle.internal.os.OperatingSystem;
plugins {
id ‘cpp-library’
}
def libIncludePath = file(System.getenv(“ORACLE_HOME”)+’/oci/include’)
def libReleaseLinkLib = file(System.getenv(“ORACLE_HOME”)+’/oci/lib/msvc/oci.lib’)
library {
linkage = [Linkage.STATIC, Linkage.SHARED]
source.from "Source/ServiceLibs/OW"
privateHeaders.from "Source/include"
privateHeaders.from "Source/ServiceLibs"
}
components.main.binaries.whenElementFinalized { binary ->
project.dependencies {
add(binary.includePathConfiguration.name, files(libIncludePath))
add(binary.linkLibraries.name, files(libReleaseLinkLib))
}
}
tasks.withType(CppCompile) {
macros.put ('OTL_ORA11G_R2','1')
macros.put ('WIN32','1')
macros.put ('_WIN32_WINNT','0x0400')
macros.put ('_USRDLL','1')
macros.put ('OTL_STL','1')
macros.put ('OTL_ORA_LEGACY_NUMERIC_TYPES','1')
macros.put ('_USRDLL','1')
macros.put ('DLL_EXPORT','1')
compilerArgs.addAll toolChain.map { NativeToolChain toolChain ->
List<String> compilerSpecificArgs = []
if (toolChain instanceof VisualCpp) {
compilerSpecificArgs << '/MD'
}
return compilerSpecificArgs
}
}
tasks.withType(LinkSharedLibrary) {
linkerArgs.addAll toolChain.map { NativeToolChain toolChain ->
List compilerSpecificArgs = []
if (toolChain instanceof VisualCpp) {
}
return compilerSpecificArgs
}
}