mirror of
				https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
				synced 2025-11-04 04:28:10 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			104 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			Groovy
		
	
	
	
	
	
			
		
		
	
	
			104 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			Groovy
		
	
	
	
	
	
model {
 | 
						|
	repositories {
 | 
						|
		libs(PrebuiltLibraries) {
 | 
						|
			mysql {
 | 
						|
				headers.srcDir "$mysql32Home/include"
 | 
						|
				binaries.withType(StaticLibraryBinary) {
 | 
						|
					def libName = "foobar"
 | 
						|
					if (buildType == buildTypes.debug) {
 | 
						|
						libName = 'libmysqld.lib'
 | 
						|
						if (targetPlatform.name == 'win32') {
 | 
						|
							staticLibraryFile = file("$mysql32Home/lib/$libName")
 | 
						|
						} else
 | 
						|
						if (targetPlatform.name == 'win64') {
 | 
						|
							headers.srcDir "$mysql64Home/include"
 | 
						|
							staticLibraryFile = file("$mysql64Home/lib/$libName")
 | 
						|
						}
 | 
						|
					} else
 | 
						|
					if (buildType == buildTypes.release) {
 | 
						|
						libName = 'libmysql.lib'
 | 
						|
						if (targetPlatform.name == 'win32') {
 | 
						|
							headers.srcDir "$mysql32Home/include"
 | 
						|
							staticLibraryFile = file("$mysql32Home/lib/$libName")
 | 
						|
						} else
 | 
						|
						if (targetPlatform.name == 'win64') {
 | 
						|
							headers.srcDir "$mysql64Home/include"
 | 
						|
							staticLibraryFile = file("$mysql64Home/lib/$libName")
 | 
						|
						}
 | 
						|
					} else {
 | 
						|
						throw new GradleException("Unknown buildType" + buildType)
 | 
						|
					}
 | 
						|
				}
 | 
						|
				binaries.withType(SharedLibraryBinary) {
 | 
						|
					def dllName
 | 
						|
					def linkName
 | 
						|
					if (buildType == buildTypes.debug) {
 | 
						|
						dllName = 'libmysqld.dll'
 | 
						|
						linkName = 'libmysqld.lib'
 | 
						|
						if (targetPlatform.name == 'win32') {
 | 
						|
							headers.srcDir "$mysql32Home/include"
 | 
						|
							sharedLibraryFile     = file("$mysql32Home/lib/$dllName")
 | 
						|
							sharedLibraryLinkFile = file("$mysql32Home/lib/$linkName")
 | 
						|
						} else
 | 
						|
						if (targetPlatform.name == 'win64') {
 | 
						|
							headers.srcDir "$mysql64Home/include"
 | 
						|
							sharedLibraryFile     = file("$mysql64Home/lib/$dllName")
 | 
						|
							sharedLibraryLinkFile = file("$mysql64Home/lib/$linkName")
 | 
						|
						}
 | 
						|
					} else
 | 
						|
					if (buildType == buildTypes.release) {
 | 
						|
						dllName = 'libmysql.dll'
 | 
						|
						linkName = 'libmysql.lib'
 | 
						|
						if (targetPlatform.name == 'win32') {
 | 
						|
							headers.srcDir "$mysql32Home/include"
 | 
						|
							sharedLibraryFile     = file("$mysql32Home/lib/$dllName")
 | 
						|
							sharedLibraryLinkFile = file("$mysql32Home/lib/$linkName")
 | 
						|
						} else
 | 
						|
						if (targetPlatform.name == 'win64') {
 | 
						|
							headers.srcDir "$mysql64Home/include"
 | 
						|
							sharedLibraryFile     = file("$mysql64Home/lib/$dllName")
 | 
						|
							sharedLibraryLinkFile = file("$mysql64Home/lib/$linkName")
 | 
						|
						}
 | 
						|
					} else {
 | 
						|
						throw new GradleException("Unknown buildType" + buildType)
 | 
						|
					}
 | 
						|
				}
 | 
						|
			}
 | 
						|
		}
 | 
						|
	}
 | 
						|
	components {
 | 
						|
		SQLMySQL(NativeLibrarySpec) {
 | 
						|
			sources {
 | 
						|
				cpp {
 | 
						|
					source {
 | 
						|
						srcDir 'src'
 | 
						|
						include '**/*.cpp'
 | 
						|
					}
 | 
						|
					exportedHeaders {
 | 
						|
						srcDir 'include'
 | 
						|
					}
 | 
						|
					lib library: 'mysql'
 | 
						|
					lib project: ':SQL', library: 'SQL'
 | 
						|
					lib project: ':Foundation', library: 'Foundation'
 | 
						|
				}
 | 
						|
			}
 | 
						|
		}
 | 
						|
	}
 | 
						|
	binaries {
 | 
						|
		all {
 | 
						|
			cppCompiler.define	"THREADSAFE"
 | 
						|
			cppCompiler.define 	"__LCC__"	
 | 
						|
			cppCompiler.define 	"WINVER=0x0600"
 | 
						|
		}
 | 
						|
		withType(SharedLibraryBinarySpec) {
 | 
						|
			if (toolChain in VisualCpp) {
 | 
						|
				cppCompiler.define	"MySQL_EXPORTS"
 | 
						|
			}
 | 
						|
		}
 | 
						|
		withType(StaticLibraryBinarySpec) {
 | 
						|
		}
 | 
						|
	}
 | 
						|
}
 | 
						|
task poco { dependsOn "assemble" }
 | 
						|
 |