2
0
mirror of https://github.com/rehlds/revoice.git synced 2024-12-27 07:05:47 +03:00
revoice/dep/speex/build.gradle
s1lentq 32ed0c8924 Fix warnings in speex library
Implemented gradle build
2015-12-14 22:07:55 +06:00

69 lines
1.5 KiB
Groovy

import org.doomedsociety.gradlecpp.cfg.ToolchainConfig
import org.doomedsociety.gradlecpp.cfg.ToolchainConfigUtils
import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig
import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig
import org.doomedsociety.gradlecpp.toolchain.icc.Icc
import org.doomedsociety.gradlecpp.toolchain.icc.IccCompilerPlugin
import org.gradle.nativeplatform.NativeBinarySpec
import org.gradle.nativeplatform.NativeLibrarySpec
import org.gradle.nativeplatform.toolchain.VisualCpp
apply plugin: 'cpp'
apply plugin: IccCompilerPlugin
void setupToolchain(NativeBinarySpec b) {
ToolchainConfig cfg = rootProject.createToolchainConfig(b)
if (cfg instanceof MsvcToolchainConfig) {
cfg.compilerOptions.args '/Ob2', '/Oi', '/GF', '/GR-'
} else if (cfg instanceof GccToolchainConfig) {
cfg.compilerOptions.languageStandard = 'c++0x'
cfg.compilerOptions.args '-msse2', '-fp-model fast=2', '-fomit-frame-pointer', '-fvisibility=hidden', '-fvisibility-inlines-hidden', '-fno-rtti', '-g0', '-s'
}
ToolchainConfigUtils.apply(project, cfg, b)
}
model {
buildTypes {
debug
release
}
platforms {
x86 {
architecture "x86"
}
}
toolChains {
visualCpp(VisualCpp) {
}
icc(Icc) {
}
}
components {
speex(NativeLibrarySpec) {
targetPlatform 'x86'
sources {
speex_src(CppSourceSet) {
source {
srcDir "src"
include "**/*.c"
}
exportedHeaders {
srcDir "include"
}
}
}
binaries.all { NativeBinarySpec b ->
project.setupToolchain(b)
}
}
}
}