diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 3ac8596..0000000 --- a/build.gradle +++ /dev/null @@ -1,55 +0,0 @@ -import versioning.GitVersioner -import versioning.RevoiceVersionInfo -import org.joda.time.DateTime - -apply plugin: 'maven-publish' -apply from: 'shared.gradle' -group = 'revoice' - -apply plugin: 'idea' - -idea { - project { - languageLevel = 'JDK_1_7' - } -} - -def gitInfo = GitVersioner.versionForDir(project.rootDir) -RevoiceVersionInfo versionInfo -if (gitInfo && gitInfo.tag && gitInfo.tag[0] == 'v') { - def m = gitInfo.tag =~ /^v(\d+)\.(\d+)(\.(\d+))?$/ - if (!m.find()) { - throw new RuntimeException("Invalid git version tag name ${gitInfo.tag}") - } - - versionInfo = new RevoiceVersionInfo( - majorVersion: m.group(1) as int, - minorVersion: m.group(2) as int, - maintenanceVersion: m.group(4) ? (m.group(4) as int) : null, - localChanges: gitInfo.localChanges, - commitDate: gitInfo.commitDate, - commitSHA: gitInfo.commitSHA, - commitURL: gitInfo.commitURL - ) -} else { - versionInfo = new RevoiceVersionInfo( - majorVersion: project.majorVersion as int, - minorVersion: project.minorVersion as int, - maintenanceVersion: project.maintenanceVersion as int, - suffix: '', - localChanges: gitInfo ? gitInfo.localChanges : true, - commitDate: gitInfo ? gitInfo.commitDate : new DateTime(), - commitSHA: gitInfo ? gitInfo.commitSHA : "", - commitURL: gitInfo ? gitInfo.commitURL : "", - commitCount: gitInfo ? (gitInfo.commitCount as int) : null - ) -} - -project.ext.revoiceVersionInfo = versionInfo -project.version = versionInfo.asMavenVersion() - -apply from: 'publish.gradle' - -task wrapper(type: Wrapper) { - gradleVersion = '2.4' -} diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle deleted file mode 100644 index 0d93aa3..0000000 --- a/buildSrc/build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -apply plugin: 'groovy' - -repositories { - //mavenLocal() - mavenCentral() - maven { - url 'http://nexus.rehlds.org/nexus/content/repositories/rehlds-releases/' - } - maven { - url 'http://nexus.rehlds.org/nexus/content/repositories/rehlds-snapshots/' - } -} - -dependencies { - compile gradleApi() - compile localGroovy() - compile 'commons-io:commons-io:2.4' - compile 'commons-lang:commons-lang:2.6' - compile 'joda-time:joda-time:2.7' - compile 'org.doomedsociety.gradlecpp:gradle-cpp-plugin:1.2' - compile 'org.eclipse.jgit:org.eclipse.jgit:3.7.0.201502260915-r' - compile 'org.apache.velocity:velocity:1.7' -} diff --git a/buildSrc/src/main/groovy/gradlecpp/VelocityUtils.groovy b/buildSrc/src/main/groovy/gradlecpp/VelocityUtils.groovy deleted file mode 100644 index f1d5f77..0000000 --- a/buildSrc/src/main/groovy/gradlecpp/VelocityUtils.groovy +++ /dev/null @@ -1,38 +0,0 @@ -package gradlecpp - -import org.apache.velocity.Template -import org.apache.velocity.VelocityContext -import org.apache.velocity.app.Velocity -import org.joda.time.format.DateTimeFormat - -class VelocityUtils { - - static { - Properties p = new Properties(); - - p.setProperty("resource.loader", "class"); - p.setProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader"); - p.setProperty("class.resource.loader.path", ""); - - p.setProperty("input.encoding", "UTF-8"); - p.setProperty("output.encoding", "UTF-8"); - - Velocity.init(p); - } - - static String renderTemplate(File tplFile, Map ctx) { - Template tpl = Velocity.getTemplate(tplFile.absolutePath) - if (!tpl) { - throw new RuntimeException("Failed to load velocity template ${tplFile.absolutePath}: not found") - } - - - def velocityContext = new VelocityContext(ctx) - velocityContext.put("_DateTimeFormat", DateTimeFormat) - - def sw = new StringWriter() - tpl.merge(velocityContext, sw) - - return sw.toString() - } -} diff --git a/buildSrc/src/main/groovy/versioning/GitInfo.groovy b/buildSrc/src/main/groovy/versioning/GitInfo.groovy deleted file mode 100644 index e0ad38f..0000000 --- a/buildSrc/src/main/groovy/versioning/GitInfo.groovy +++ /dev/null @@ -1,16 +0,0 @@ -package versioning - -import groovy.transform.CompileStatic -import groovy.transform.TypeChecked -import org.joda.time.DateTime - -@CompileStatic @TypeChecked -class GitInfo { - boolean localChanges - DateTime commitDate - String branch - String tag - String commitSHA - String commitURL - Integer commitCount -} diff --git a/buildSrc/src/main/groovy/versioning/GitVersioner.groovy b/buildSrc/src/main/groovy/versioning/GitVersioner.groovy deleted file mode 100644 index 88a295c..0000000 --- a/buildSrc/src/main/groovy/versioning/GitVersioner.groovy +++ /dev/null @@ -1,125 +0,0 @@ -package versioning - -import java.util.Set; - -import groovy.transform.CompileStatic -import groovy.transform.TypeChecked -import org.eclipse.jgit.api.Git -import org.eclipse.jgit.api.Status; -import org.eclipse.jgit.lib.ObjectId -import org.eclipse.jgit.lib.Repository -import org.eclipse.jgit.lib.StoredConfig -import org.eclipse.jgit.revwalk.RevCommit -import org.eclipse.jgit.revwalk.RevWalk -import org.eclipse.jgit.storage.file.FileRepositoryBuilder -import org.joda.time.DateTime -import org.joda.time.DateTimeZone - -@CompileStatic @TypeChecked -class GitVersioner { - - static GitInfo versionForDir(String dir) { - versionForDir(new File(dir)) - } - static int getCountCommit(Repository repo) { - Iterable commits = Git.wrap(repo).log().call() - int count = 0; - commits.each { - count++; - } - - return count; - } - static String prepareUrlToCommits(String url) { - if (url == null) { - // default remote url - return "https://github.com/s1lentq/Revoice/commit/"; - } - - StringBuilder sb = new StringBuilder(); - String childPath; - int pos = url.indexOf('@'); - if (pos != -1) { - childPath = url.substring(pos + 1, url.lastIndexOf('.git')).replace(':', '/'); - sb.append('https://'); - } else { - pos = url.lastIndexOf('.git'); - childPath = (pos == -1) ? url : url.substring(0, pos); - } - - // support for different links to history of commits - if (url.indexOf('bitbucket.org') != -1) { - sb.append(childPath).append('/commits/'); - } else { - sb.append(childPath).append('/commit/'); - } - return sb.toString(); - } - // check uncommited changes - static boolean getUncommittedChanges(Repository repo) { - Git git = new Git(repo); - Status status = git.status().call(); - - Set uncommittedChanges = status.getUncommittedChanges(); - for(String uncommitted : uncommittedChanges) { - return true; - } - - return false; - } - static GitInfo versionForDir(File dir) { - FileRepositoryBuilder builder = new FileRepositoryBuilder(); - Repository repo = builder.setWorkTree(dir) - .findGitDir() - .build() - - ObjectId head = repo.resolve('HEAD'); - if (!head) { - return null - } - - final StoredConfig cfg = repo.getConfig(); - def commit = new RevWalk(repo).parseCommit(head); - if (!commit) { - throw new RuntimeException("Can't find last commit."); - } - - def localChanges = getUncommittedChanges(repo); - def commitDate = new DateTime(1000L * commit.commitTime, DateTimeZone.UTC); - if (localChanges) { - commitDate = new DateTime(); - } - - def branch = repo.getBranch(); - - String url = null; - String remote_name = cfg.getString("branch", branch, "remote"); - - if (remote_name == null) { - for (String remotes : cfg.getSubsections("remote")) { - if (url != null) { - println 'Found a second remote: (' + remotes + '), url: (' + cfg.getString("remote", remotes, "url") + ')' - continue; - } - - url = cfg.getString("remote", remotes, "url"); - } - } else { - url = cfg.getString("remote", remote_name, "url"); - } - - String commitURL = prepareUrlToCommits(url); - String tag = repo.tags.find { kv -> kv.value.objectId == commit.id }?.key - String commitSHA = commit.getId().abbreviate(7).name(); - - return new GitInfo( - localChanges: localChanges, - commitDate: commitDate, - branch: branch, - tag: tag, - commitSHA: commitSHA, - commitURL: commitURL, - commitCount: getCountCommit(repo) - ) - } -} diff --git a/buildSrc/src/main/groovy/versioning/RevoiceVersionInfo.groovy b/buildSrc/src/main/groovy/versioning/RevoiceVersionInfo.groovy deleted file mode 100644 index bfdaff3..0000000 --- a/buildSrc/src/main/groovy/versioning/RevoiceVersionInfo.groovy +++ /dev/null @@ -1,58 +0,0 @@ -package versioning - -import groovy.transform.CompileStatic -import groovy.transform.ToString -import groovy.transform.TypeChecked -import org.joda.time.format.DateTimeFormat -import org.joda.time.DateTime - -@CompileStatic @TypeChecked -@ToString(includeNames = true) -class RevoiceVersionInfo { - Integer majorVersion - Integer minorVersion - Integer maintenanceVersion - String suffix - - boolean localChanges - DateTime commitDate - String commitSHA - String commitURL - Integer commitCount - - String asMavenVersion(boolean extra = true, String separator = ".") { - StringBuilder sb = new StringBuilder() - sb.append(majorVersion).append(separator).append(minorVersion); - if (maintenanceVersion != null) { - sb.append(separator).append(maintenanceVersion); - } - - if (commitCount != null) { - sb.append(separator).append(commitCount) - } - - if (extra && suffix) { - sb.append('-' + suffix) - } - - // do mark for this build like a modified version - if (extra && localChanges) { - sb.append('+m'); - } - - return sb.toString() - } - String asCommitDate(String pattern = null) { - if (pattern == null) { - pattern = "MMM d yyyy"; - if (commitDate.getDayOfMonth() >= 10) { - pattern = "MMM d yyyy"; - } - } - - return DateTimeFormat.forPattern(pattern).withLocale(Locale.ENGLISH).print(commitDate); - } - String asCommitTime() { - return DateTimeFormat.forPattern('HH:mm:ss').withLocale(Locale.ENGLISH).print(commitDate); - } -} diff --git a/dep/opus/build.gradle b/dep/opus/build.gradle deleted file mode 100644 index 92b8a53..0000000 --- a/dep/opus/build.gradle +++ /dev/null @@ -1,71 +0,0 @@ -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) - - cfg.projectInclude(project, '', '/src', '/include', '/celt', '/celt/x86', '/silk', '/silk/float') - cfg.singleDefines('OPUS_BUILD', 'USE_ALLOCA'); - - 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 { - opus(NativeLibrarySpec) { - targetPlatform 'x86' - - sources { - opus_src(CppSourceSet) { - source { - srcDirs "src", "silk", "celt" - include "**/*.c" - } - - exportedHeaders { - srcDirs "celt", "silk", "include" - } - } - } - - binaries.all { NativeBinarySpec b -> - project.setupToolchain(b) - } - } - } -} diff --git a/dep/opus/msvc/Opus.vcxproj b/dep/opus/msvc/Opus.vcxproj deleted file mode 100644 index a2f9cde..0000000 --- a/dep/opus/msvc/Opus.vcxproj +++ /dev/null @@ -1,283 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {B17B3098-0141-46EA-BD8E-B98E0C92A81A} - Win32Proj - Opus - 8.1 - - - - StaticLibrary - true - v140 - Unicode - - - StaticLibrary - false - v140 - true - Unicode - - - - - - - - - - - - - - - - - - - Level3 - Disabled - OPUS_BUILD;USE_ALLOCA;WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - $(ProjectDir)../src/;$(ProjectDir)../include/;$(ProjectDir)../silk/;$(ProjectDir)../silk/float/;$(ProjectDir)../celt/;%(AdditionalIncludeDirectories) - - - Windows - - - - - Level3 - - - MaxSpeed - true - true - OPUS_BUILD;USE_ALLOCA;WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - $(ProjectDir)../src/;$(ProjectDir)../include/;$(ProjectDir)../silk/;$(ProjectDir)../silk/float/;$(ProjectDir)../celt/;%(AdditionalIncludeDirectories) - - - Windows - true - true - - - - - - \ No newline at end of file diff --git a/dep/opus/msvc/Opus.vcxproj.filters b/dep/opus/msvc/Opus.vcxproj.filters deleted file mode 100644 index da5a6b6..0000000 --- a/dep/opus/msvc/Opus.vcxproj.filters +++ /dev/null @@ -1,618 +0,0 @@ - - - - - {7d32f27a-7c3d-4de7-a516-a7d610c4f69e} - - - {0b20d093-5ae4-4f22-8068-73f34c3bed57} - - - {73d22437-9d1e-40d1-abc7-06f498bb2b23} - - - {28664137-6d7d-4021-bea7-886dda81b102} - - - {f3bcf017-41ef-4040-995b-87fd48848d99} - - - - - include - - - include - - - include - - - include - - - include - - - src - - - src - - - src - - - src - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk\float - - - silk\float - - - silk\float - - - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - celt - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - silk\float - - - \ No newline at end of file diff --git a/dep/silk/build.gradle b/dep/silk/build.gradle deleted file mode 100644 index 4b9e2b0..0000000 --- a/dep/silk/build.gradle +++ /dev/null @@ -1,68 +0,0 @@ -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 { - silk(NativeLibrarySpec) { - targetPlatform 'x86' - - sources { - silk_src(CppSourceSet) { - source { - srcDir "src" - include "**/*.c" - } - - exportedHeaders { - srcDir "include" - } - } - } - - binaries.all { NativeBinarySpec b -> - project.setupToolchain(b) - } - } - } -} diff --git a/dep/silk/msvc/Silk.vcxproj b/dep/silk/msvc/Silk.vcxproj deleted file mode 100644 index 31180d4..0000000 --- a/dep/silk/msvc/Silk.vcxproj +++ /dev/null @@ -1,237 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {E1AC990E-C012-4167-80C2-84C98AA7070C} - Win32Proj - Silk - 8.1 - - - - StaticLibrary - true - v140_xp - MultiByte - - - StaticLibrary - false - v140_xp - true - MultiByte - - - - - - - - - - - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - $(ProjectDir)../src/;$(ProjectDir)../include/;%(AdditionalIncludeDirectories) - - - Windows - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - $(ProjectDir)../src/;$(ProjectDir)../include/;%(AdditionalIncludeDirectories) - - - Windows - true - true - true - - - - - - \ No newline at end of file diff --git a/dep/silk/msvc/Silk.vcxproj.filters b/dep/silk/msvc/Silk.vcxproj.filters deleted file mode 100644 index 5eaa99a..0000000 --- a/dep/silk/msvc/Silk.vcxproj.filters +++ /dev/null @@ -1,471 +0,0 @@ - - - - - {2d0a55da-cb02-4e2a-88f1-bb168d980c8d} - - - {0c504531-1360-49f4-868f-1004665b6532} - - - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - include - - - include - - - include - - - include - - - \ No newline at end of file diff --git a/dep/speex/build.gradle b/dep/speex/build.gradle deleted file mode 100644 index fc50453..0000000 --- a/dep/speex/build.gradle +++ /dev/null @@ -1,68 +0,0 @@ -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) - } - } - } -} diff --git a/dep/speex/msvc/Speex.vcxproj b/dep/speex/msvc/Speex.vcxproj deleted file mode 100644 index ca5f68a..0000000 --- a/dep/speex/msvc/Speex.vcxproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {966DE7A9-EC15-4C1D-8B46-EA813A845723} - Win32Proj - Speex - 8.1 - - - - StaticLibrary - true - v140_xp - MultiByte - - - StaticLibrary - false - v140_xp - true - MultiByte - - - - - - - - - - - - - - - - - TurnOffAllWarnings - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - $(ProjectDir)../src/;$(ProjectDir)../include/;%(AdditionalIncludeDirectories) - - - Windows - true - - - - - TurnOffAllWarnings - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - $(ProjectDir)../src/;$(ProjectDir)../include/;%(AdditionalIncludeDirectories) - - - Windows - true - true - true - - - - - - \ No newline at end of file diff --git a/dep/speex/msvc/Speex.vcxproj.filters b/dep/speex/msvc/Speex.vcxproj.filters deleted file mode 100644 index 34139fd..0000000 --- a/dep/speex/msvc/Speex.vcxproj.filters +++ /dev/null @@ -1,165 +0,0 @@ - - - - - {64149522-0cdb-49e1-b9f5-d3c89ac3cd33} - - - {1b002234-71db-4d9c-8d15-0e5efed1c3b6} - - - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - \ No newline at end of file diff --git a/getucrtinfo.bat b/getucrtinfo.bat deleted file mode 100644 index 29f5bb1..0000000 --- a/getucrtinfo.bat +++ /dev/null @@ -1,19 +0,0 @@ -@echo off - -if defined VS150COMNTOOLS ( - if not exist "%VS150COMNTOOLS%vcvarsqueryregistry.bat" goto NoVS - call "%VS150COMNTOOLS%vcvarsqueryregistry.bat" - goto :run -) else if defined VS140COMNTOOLS ( - if not exist "%VS140COMNTOOLS%vcvarsqueryregistry.bat" goto NoVS - call "%VS140COMNTOOLS%vcvarsqueryregistry.bat" - goto :run -) - -:NoVS -echo Error: Visual Studio 2015 or 2017 required. -exit /b 1 - -:run -echo %UniversalCRTSdkDir% -echo %UCRTVersion% diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index d3247d7..0000000 --- a/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -majorVersion=0 -minorVersion=1 -maintenanceVersion=0 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 175c642..0000000 Binary files a/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 82683f2..0000000 --- a/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Sat May 02 13:29:15 BRT 2015 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip diff --git a/gradlew b/gradlew deleted file mode 100755 index 91a7e26..0000000 --- a/gradlew +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat deleted file mode 100644 index 8a0b282..0000000 --- a/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/msvc/revoice.sln b/msvc/revoice.sln deleted file mode 100644 index 5d66aa2..0000000 --- a/msvc/revoice.sln +++ /dev/null @@ -1,44 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "revoice", "..\revoice\msvc\revoice.vcxproj", "{DAEFE371-7D77-4B72-A8A5-3CD3D1A55786}" - ProjectSection(ProjectDependencies) = postProject - {E1AC990E-C012-4167-80C2-84C98AA7070C} = {E1AC990E-C012-4167-80C2-84C98AA7070C} - {966DE7A9-EC15-4C1D-8B46-EA813A845723} = {966DE7A9-EC15-4C1D-8B46-EA813A845723} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Silk", "..\dep\silk\msvc\Silk.vcxproj", "{E1AC990E-C012-4167-80C2-84C98AA7070C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Speex", "..\dep\speex\msvc\Speex.vcxproj", "{966DE7A9-EC15-4C1D-8B46-EA813A845723}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Opus", "..\dep\opus\msvc\Opus.vcxproj", "{B17B3098-0141-46EA-BD8E-B98E0C92A81A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DAEFE371-7D77-4B72-A8A5-3CD3D1A55786}.Debug|Win32.ActiveCfg = Debug|Win32 - {DAEFE371-7D77-4B72-A8A5-3CD3D1A55786}.Debug|Win32.Build.0 = Debug|Win32 - {DAEFE371-7D77-4B72-A8A5-3CD3D1A55786}.Release|Win32.ActiveCfg = Release|Win32 - {DAEFE371-7D77-4B72-A8A5-3CD3D1A55786}.Release|Win32.Build.0 = Release|Win32 - {E1AC990E-C012-4167-80C2-84C98AA7070C}.Debug|Win32.ActiveCfg = Debug|Win32 - {E1AC990E-C012-4167-80C2-84C98AA7070C}.Debug|Win32.Build.0 = Debug|Win32 - {E1AC990E-C012-4167-80C2-84C98AA7070C}.Release|Win32.ActiveCfg = Release|Win32 - {E1AC990E-C012-4167-80C2-84C98AA7070C}.Release|Win32.Build.0 = Release|Win32 - {966DE7A9-EC15-4C1D-8B46-EA813A845723}.Debug|Win32.ActiveCfg = Debug|Win32 - {966DE7A9-EC15-4C1D-8B46-EA813A845723}.Debug|Win32.Build.0 = Debug|Win32 - {966DE7A9-EC15-4C1D-8B46-EA813A845723}.Release|Win32.ActiveCfg = Release|Win32 - {966DE7A9-EC15-4C1D-8B46-EA813A845723}.Release|Win32.Build.0 = Release|Win32 - {B17B3098-0141-46EA-BD8E-B98E0C92A81A}.Debug|Win32.ActiveCfg = Debug|Win32 - {B17B3098-0141-46EA-BD8E-B98E0C92A81A}.Debug|Win32.Build.0 = Debug|Win32 - {B17B3098-0141-46EA-BD8E-B98E0C92A81A}.Release|Win32.ActiveCfg = Release|Win32 - {B17B3098-0141-46EA-BD8E-B98E0C92A81A}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/publish.gradle b/publish.gradle deleted file mode 100644 index a0fe262..0000000 --- a/publish.gradle +++ /dev/null @@ -1,43 +0,0 @@ -import org.doomedsociety.gradlecpp.GradleCppUtils -import org.apache.commons.io.FilenameUtils - -void _copyFileToDir(String from, String to) { - def dst = new File(project.file(to), FilenameUtils.getName(from)) - GradleCppUtils.copyFile(project.file(from), dst, false) -} - -void _copyFile(String from, String to) { - GradleCppUtils.copyFile(project.file(from), project.file(to), false) -} - -task publishPrepareFiles << { - def pubRootDir = project.file('publish/publishRoot') - if (pubRootDir.exists()) { - if (!pubRootDir.deleteDir()) { - throw new RuntimeException("Failed to delete ${pubRootDir}") - } - } - - pubRootDir.mkdirs() - - project.file('publish/publishRoot/revoice/bin/win32').mkdirs() - project.file('publish/publishRoot/revoice/bin/linux32').mkdirs() - - _copyFileToDir('publish/revoice_mm.dll', 'publish/publishRoot/revoice/bin/win32/') - _copyFile('publish/librevoice_mm_i386.so', 'publish/publishRoot/revoice/bin/linux32/revoice_mm_i386.so') - - copy { - from 'revoice/dist' - into 'publish/publishRoot/revoice' - } -} - -task publishPackage(type: Zip, dependsOn: 'publishPrepareFiles') { - baseName = "revoice_${project.version}" - destinationDir file('publish') - from 'publish/publishRoot/revoice' -} - -task doPackage { - dependsOn 'publishPackage' -} diff --git a/revoice/build.gradle b/revoice/build.gradle deleted file mode 100644 index a193e3b..0000000 --- a/revoice/build.gradle +++ /dev/null @@ -1,204 +0,0 @@ -import org.doomedsociety.gradlecpp.GradleCppUtils -import org.doomedsociety.gradlecpp.toolchain.icc.IccCompilerPlugin -import org.doomedsociety.gradlecpp.toolchain.icc.Icc -import org.doomedsociety.gradlecpp.cfg.ToolchainConfig -import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig -import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig -import org.doomedsociety.gradlecpp.cfg.ToolchainConfigUtils -import org.gradle.language.cpp.CppSourceSet -import org.gradle.language.rc.tasks.WindowsResourceCompile -import org.gradle.nativeplatform.NativeBinarySpec -import versioning.RevoiceVersionInfo -import gradlecpp.VelocityUtils - -apply plugin: 'cpp' -apply plugin: 'windows-resources' -apply plugin: IccCompilerPlugin - -project.ext.dep_opus = project(':dep/opus') -project.ext.dep_silk = project(':dep/silk') -project.ext.dep_speex = project(':dep/speex') - -List getRcCompileTasks(NativeBinarySpec binary) { - def linkTask = GradleCppUtils.getLinkTask(binary) - - def res = linkTask.taskDependencies.getDependencies(linkTask).findAll { Task t -> t instanceof WindowsResourceCompile } - return res as List -} - -void postEvaluate(NativeBinarySpec b) { - if (GradleCppUtils.windows) { - getRcCompileTasks(b).each { Task t -> - t.dependsOn project.generateAppVersion - } - } else { - // attach generateAppVersion task to all 'compile source' tasks - GradleCppUtils.getCompileTasks(b).each { Task t -> - t.dependsOn project.generateAppVersion - } - } -} - -void setupToolchain(NativeBinarySpec b) { - ToolchainConfig cfg = rootProject.createToolchainConfig(b) - cfg.projectInclude(project, '', '/src') - cfg.projectInclude(rootProject, '/dep/rehlsdk/common', '/dep/rehlsdk/engine', '/dep/rehlsdk/dlls', '/dep/rehlsdk/public', '/dep/metamod', '/revoice/public') - - if (cfg instanceof MsvcToolchainConfig) { - cfg.compilerOptions.pchConfig = new MsvcToolchainConfig.PrecompiledHeadersConfig( - enabled: true, - pchHeader: 'precompiled.h', - pchSourceSet: 'revoice_pch' - ) - cfg.compilerOptions.args '/Ob2', '/Oi', '/GF', '/GR-' - cfg.singleDefines('_CRT_SECURE_NO_WARNINGS') - cfg.extraLibs 'ws2_32.lib' - } else if (cfg instanceof GccToolchainConfig) { - cfg.compilerOptions.pchConfig = new GccToolchainConfig.PrecompilerHeaderOptions( - enabled: true, - pchSourceSet: 'revoice_pch' - ) - cfg.compilerOptions.languageStandard = 'c++11' - cfg.defines([ - '_stricmp': 'strcasecmp', - '_strnicmp': 'strncasecmp', - '_vsnprintf': 'vsnprintf', - '_snprintf': 'snprintf' - ]) - - cfg.compilerOptions.args '-Qoption,cpp,--treat_func_as_string_literal_cpp', '-msse2', '-fp-model fast', '-fomit-frame-pointer', '-fvisibility=hidden', '-fvisibility-inlines-hidden', '-fno-rtti', '-g0', '-s' - } - - ToolchainConfigUtils.apply(project, cfg, b) - - GradleCppUtils.onTasksCreated(project, 'postEvaluate', { - postEvaluate(b) - }) -} - -model { - buildTypes { - debug - release - } - - platforms { - x86 { - architecture "x86" - } - } - - toolChains { - visualCpp(VisualCpp) { - } - icc(Icc) { - } - } - - components { - revoice(NativeLibrarySpec) { - targetPlatform 'x86' - baseName GradleCppUtils.windows ? 'revoice_mm' : 'revoice_mm_i386' - - sources { - - revoice_pch(CppSourceSet) { - source { - srcDirs "src" - include "precompiled.cpp" - } - - exportedHeaders { - srcDirs "include", "version" - } - - lib project: ':dep/opus', library: 'opus', linkage: 'static' - lib project: ':dep/silk', library: 'silk', linkage: 'static' - lib project: ':dep/speex', library: 'speex', linkage: 'static' - } - - revoice_src(CppSourceSet) { - source { - srcDirs "src", "public" - include "**/*.cpp" - - exclude "precompiled.cpp" - exclude "engine_api.cpp" - } - - exportedHeaders { - srcDirs "include", "version" - } - - lib project: ':dep/opus', library: 'opus', linkage: 'static' - lib project: ':dep/silk', library: 'silk', linkage: 'static' - lib project: ':dep/speex', library: 'speex', linkage: 'static' - } - rc { - source { - srcDir "msvc" - include "revoice.rc" - } - exportedHeaders { - srcDirs "msvc" - } - } - } - - binaries.all { - NativeBinarySpec b -> project.setupToolchain(b) - } - } - } -} - -afterEvaluate { - project.binaries.all { - NativeBinarySpec binary -> - Tool linker = binary.linker - - if (GradleCppUtils.windows) { - linker.args "/DEF:${projectDir}\\msvc\\revoice.def" - } - } -} - -task buildRelease { - dependsOn binaries.withType(SharedLibraryBinarySpec).matching { SharedLibraryBinarySpec blib -> - blib.buildable && blib.buildType.name == 'release' - } -} - -tasks.clean.doLast { - project.file('version/appversion.h').delete() -} - -task generateAppVersion { - - RevoiceVersionInfo verInfo = (RevoiceVersionInfo) rootProject.revoiceVersionInfo - def tplFile = project.file('version/appversion.vm') - def renderedFile = project.file('version/appversion.h') - - // check to up-to-date - inputs.file tplFile - inputs.file project.file('gradle.properties') - outputs.file renderedFile - - // this will ensure that this task is redone when the versions change - inputs.property('version', rootProject.version) - inputs.property('commitDate', verInfo.asCommitDate()) - - println "##teamcity[buildNumber '" + verInfo.asMavenVersion(false) + "']"; - - doLast { - def templateCtx = [ - verInfo: verInfo - ] - - def content = VelocityUtils.renderTemplate(tplFile, templateCtx) - renderedFile.delete() - renderedFile.write(content, 'utf-8') - - println 'The current Revoice maven version is ' + rootProject.version + ', url: (' + verInfo.commitURL + '' + verInfo.commitSHA + ')'; - } -} diff --git a/revoice/msvc/PostBuild.bat b/revoice/msvc/PostBuild.bat deleted file mode 100644 index 8583878..0000000 --- a/revoice/msvc/PostBuild.bat +++ /dev/null @@ -1,39 +0,0 @@ -@echo OFF -:: -:: Post-build auto-deploy script -:: Create and fill PublishPath.txt file with path to deployment folder -:: I.e. PublishPath.txt should contain one line with a folder path -:: Call it so: -:: IF EXIST "$(ProjectDir)PostBuild.bat" (CALL "$(ProjectDir)PostBuild.bat" "$(TargetDir)" "$(TargetName)" "$(TargetExt)" "$(ProjectDir)") -:: - -SET targetDir=%~1 -SET targetName=%~2 -SET targetExt=%~3 -SET projectDir=%~4 -SET destination= - -IF NOT EXIST "%projectDir%\PublishPath.txt" ( - ECHO No deployment path specified. Create PublishPath.txt near PostBuild.bat with paths on separate lines for auto deployment. - exit /B 0 -) - -FOR /f "tokens=* delims= usebackq" %%a IN ("%projectDir%\PublishPath.txt") DO ( - ECHO Deploying to: %%a - IF NOT "%%a" == "" ( - copy /Y "%targetDir%%targetName%%targetExt%" "%%a" - IF NOT ERRORLEVEL 1 ( - IF EXIST "%targetDir%%targetName%.pdb" ( - copy /Y "%targetDir%%targetName%.pdb" "%%a" - ) - ) ELSE ( - ECHO PostBuild.bat ^(27^) : warning : Can't copy '%targetName%%targetExt%' to deploy path '%%a' - ) - ) -) - -IF "%%a" == "" ( - ECHO No deployment path specified. -) - -exit /B 0 \ No newline at end of file diff --git a/revoice/msvc/PreBuild.bat b/revoice/msvc/PreBuild.bat deleted file mode 100644 index 9342689..0000000 --- a/revoice/msvc/PreBuild.bat +++ /dev/null @@ -1,221 +0,0 @@ -@setlocal enableextensions enabledelayedexpansion -@echo off -:: -:: Pre-build auto-versioning script -:: - -set srcdir=%~1 -set repodir=%~2 - -set old_version= -set version_major=0 -set version_minor=0 -set version_modifed= -set svn_old_number=664 - -set commitSHA= -set commitURL= -set commitCount=0 -set branch_name=master - -for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set "dt=%%a" -set "YYYY=%dt:~0,4%" -set "MM=%dt:~4,2%" -set "DD=%dt:~6,2%" -set "hour=%dt:~8,2%" -set "min=%dt:~10,2%" -set "sec=%dt:~12,2%" - -for /f "tokens=%MM%" %%I in ("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec") do set "month=%%I" - -:: -:: Check for git.exe presence -:: -CALL git.exe describe >NUL 2>&1 -set errlvl="%ERRORLEVEL%" - -:: -:: Read old appversion.h, if present -:: -IF EXIST "%srcdir%\appversion.h" ( - FOR /F "usebackq tokens=1,2,3" %%i in ("%srcdir%\appversion.h") do ( - IF %%i==#define ( - IF %%j==APP_VERSION ( - :: Remove quotes - set v=%%k - set old_version=!v:"=! - ) - ) - ) -) - -IF %errlvl% == "1" ( - echo can't locate git.exe - auto-versioning step won't be performed - - :: if we haven't appversion.h, we need to create it - IF NOT "%old_version%" == "" ( - set commitCount=0 - ) -) - -:: -:: Read major, minor and maintenance version components from Version.h -:: -IF EXIST "%srcdir%\version.h" ( - FOR /F "usebackq tokens=1,2,3" %%i in ("%srcdir%\version.h") do ( - IF %%i==#define ( - IF %%j==VERSION_MAJOR set version_major=%%k - IF %%j==VERSION_MINOR set version_minor=%%k - ) - ) -) ELSE ( - FOR /F "usebackq tokens=1,2,3,* delims==" %%i in ("%repodir%..\gradle.properties") do ( - IF NOT [%%j] == [] ( - IF %%i==majorVersion set version_major=%%j - IF %%i==minorVersion set version_minor=%%j - ) - ) -) - -:: -:: Read revision and release date from it -:: -IF NOT %errlvl% == "1" ( - :: Get current branch - FOR /F "tokens=*" %%i IN ('"git -C "%repodir%\." rev-parse --abbrev-ref HEAD"') DO ( - set branch_name=%%i - ) - - FOR /F "tokens=*" %%i IN ('"git -C "%repodir%\." rev-list --count !branch_name!"') DO ( - IF NOT [%%i] == [] ( - set /a commitCount=%%i+%svn_old_number% - ) - ) -) - -:: -:: Get remote url repository -:: -IF NOT %errlvl% == "1" ( - - set branch_remote=origin - :: Get remote name by current branch - FOR /F "tokens=*" %%i IN ('"git -C "%repodir%\." config branch.!branch_name!.remote"') DO ( - set branch_remote=%%i - ) - :: Get remote url - FOR /F "tokens=2 delims=@" %%i IN ('"git -C "%repodir%\." config remote.!branch_remote!.url"') DO ( - set commitURL=%%i - ) - :: Get commit id - FOR /F "tokens=*" %%i IN ('"git -C "%repodir%\." rev-parse --verify HEAD"') DO ( - set shafull=%%i - set commitSHA=!shafull:~0,+7! - ) - - IF [!commitURL!] == [] ( - - FOR /F "tokens=1" %%i IN ('"git -C "%repodir%\." config remote.!branch_remote!.url"') DO ( - set commitURL=%%i - ) - - :: strip .git - if "x!commitURL:~-4!"=="x.git" ( - set commitURL=!commitURL:~0,-4! - ) - - :: append extra string - If NOT "!commitURL!"=="!commitURL:bitbucket.org=!" ( - set commitURL=!commitURL!/commits/ - ) ELSE ( - set commitURL=!commitURL!/commit/ - ) - - ) ELSE ( - :: strip .git - if "x!commitURL:~-4!"=="x.git" ( - set commitURL=!commitURL:~0,-4! - ) - :: replace : to / - set commitURL=!commitURL::=/! - - :: append extra string - If NOT "!commitURL!"=="!commitURL:bitbucket.org=!" ( - set commitURL=https://!commitURL!/commits/ - ) ELSE ( - set commitURL=https://!commitURL!/commit/ - ) - ) -) - -:: -:: Detect local modifications -:: -set localChanged=0 -IF NOT %errlvl% == "1" ( - FOR /F "tokens=*" %%i IN ('"git -C "%repodir%\." ls-files -m"') DO ( - set localChanged=1 - ) -) - -IF [%localChanged%]==[1] ( - set version_modifed=+m -) - -:: -:: Now form full version string like 1.0.0.1 -:: - -set new_version=%version_major%.%version_minor%.%commitCount%%version_modifed% - -:: -:: Update appversion.h if version has changed or modifications/mixed revisions detected -:: -IF NOT "%new_version%"=="%old_version%" ( - goto _update -) - -goto _exit - -:_update - -:: -:: Write appversion.h -:: -echo Updating appversion.h, new version is "%new_version%", the old one was %old_version% - -echo #ifndef __APPVERSION_H__>"%srcdir%\appversion.h" -echo #define __APPVERSION_H__>>"%srcdir%\appversion.h" -echo.>>"%srcdir%\appversion.h" -echo // >>"%srcdir%\appversion.h" -echo // This file is generated automatically.>>"%srcdir%\appversion.h" -echo // Don't edit it.>>"%srcdir%\appversion.h" -echo // >>"%srcdir%\appversion.h" -echo.>>"%srcdir%\appversion.h" -echo // Version defines>>"%srcdir%\appversion.h" -echo #define APP_VERSION "%new_version%">>"%srcdir%\appversion.h" - ->>"%srcdir%\appversion.h" echo #define APP_VERSION_C %version_major%,%version_minor%,%commitCount% -echo #define APP_VERSION_STRD "%version_major%.%version_minor%.%commitCount%">>"%srcdir%\appversion.h" -echo #define APP_VERSION_FLAGS 0x0L>>"%srcdir%\appversion.h" - -echo.>>"%srcdir%\appversion.h" -echo #define APP_COMMIT_DATE "%YYYY%-%DD%-%MM%">>"%srcdir%\appversion.h" -echo #define APP_COMMIT_TIME "%hour%:%min%:%sec%">>"%srcdir%\appversion.h" - -echo.>>"%srcdir%\appversion.h" -echo #define APP_COMMIT_SHA "%commitSHA%">>"%srcdir%\appversion.h" -echo #define APP_COMMIT_URL "%commitURL%">>"%srcdir%\appversion.h" -echo.>>"%srcdir%\appversion.h" - -echo #endif //__APPVERSION_H__>>"%srcdir%\appversion.h" -echo.>>"%srcdir%\appversion.h" - -:: -:: Do update of version.cpp file last modify time to force it recompile -:: -copy /b "%srcdir%\version.cpp"+,, "%srcdir%\version.cpp" -endlocal - -:_exit -exit /B 0 diff --git a/revoice/msvc/resource.h b/revoice/msvc/resource.h deleted file mode 100644 index 7c3f681..0000000 --- a/revoice/msvc/resource.h +++ /dev/null @@ -1,14 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by ReVoice.rc - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/revoice/msvc/revoice.def b/revoice/msvc/revoice.def deleted file mode 100644 index d0b3a60..0000000 --- a/revoice/msvc/revoice.def +++ /dev/null @@ -1,5 +0,0 @@ -LIBRARY revoice_mm -EXPORTS - GiveFnptrsToDll @1 -SECTIONS - .data READ WRITE diff --git a/revoice/msvc/revoice.rc b/revoice/msvc/revoice.rc deleted file mode 100644 index 4534022..0000000 --- a/revoice/msvc/revoice.rc +++ /dev/null @@ -1,107 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" -#include "..\version\appversion.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Neutral resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) -#ifdef _WIN32 -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#pragma code_page(1251) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -VS_VERSION_INFO VERSIONINFO -FILEVERSION APP_VERSION_C -PRODUCTVERSION APP_VERSION_C -FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -#ifdef _DEBUG - FILEFLAGS (APP_VERSION_FLAGS | VS_FF_DEBUG) -#else - FILEFLAGS (APP_VERSION_FLAGS) -#endif -FILEOS VOS__WINDOWS32 -FILETYPE VFT_DLL -FILESUBTYPE VFT2_UNKNOWN - -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "041904b0" - BEGIN - VALUE "CompanyName", "ReHLDS Team" - VALUE "FileDescription", "Voice transcoding module for ReHLDS" - VALUE "FileVersion", APP_VERSION_STRD - VALUE "InternalName", "Revoice" - VALUE "LegalCopyright", "Copyright (c) 2015" - VALUE "OriginalFilename", "revoice_mm.dll" - VALUE "ProductName", "Revoice" - VALUE "ProductVersion", APP_VERSION_STRD - #if APP_VERSION_FLAGS != 0x0L - VALUE "SpecialBuild", APP_VERSION_SPECIALBUILD - #endif - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0, 1200 - END -END - -#endif // Neutral resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED diff --git a/revoice/msvc/revoice.vcxproj b/revoice/msvc/revoice.vcxproj deleted file mode 100644 index 01ec10a..0000000 --- a/revoice/msvc/revoice.vcxproj +++ /dev/null @@ -1,230 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - true - - - - - - - - true - true - - - - - Create - Create - - - - - - - - - - - - - - - - true - true - - - - - {b17b3098-0141-46ea-bd8e-b98e0c92a81a} - - - {e1ac990e-c012-4167-80c2-84c98aa7070c} - - - {966de7a9-ec15-4c1d-8b46-ea813a845723} - - - - - - true - true - - - - - - - - {DAEFE371-7D77-4B72-A8A5-3CD3D1A55786} - Win32Proj - revoice - 8.1 - - - - DynamicLibrary - true - v140_xp - MultiByte - - - DynamicLibrary - false - v140_xp - true - MultiByte - - - - - - - - - - - - - true - revoice_mm - - - false - revoice_mm - - - - Use - Level3 - Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - $(ProjectDir)../src/;$(ProjectDir)../public/;$(ProjectDir)../version/;$(ProjectDir)../include/;$(SolutionDir)../dep/rehlsdk/common/;$(SolutionDir)../dep/rehlsdk/dlls/;$(SolutionDir)../dep/rehlsdk/engine/;$(SolutionDir)../dep/rehlsdk/public/;$(SolutionDir)../dep/silk/include/;$(SolutionDir)../dep/opus/include/;$(SolutionDir)../dep/speex/include/;$(SolutionDir)../dep/metamod/;%(AdditionalIncludeDirectories) - precompiled.h - - - Windows - true - ws2_32.lib;%(AdditionalDependencies) - revoice.def - - - IF EXIST "$(ProjectDir)PostBuild.bat" (CALL "$(ProjectDir)PostBuild.bat" "$(TargetDir)" "$(TargetName)" "$(TargetExt)" "$(ProjectDir)") -IF EXIST "$(ProjectDir)start_6153.bat" (CALL "$(ProjectDir)start_6153.bat") - - - Automatic deployment script - - - IF EXIST "$(ProjectDir)PreBuild.bat" (CALL "$(ProjectDir)PreBuild.bat" "$(ProjectDir)..\version\" "$(ProjectDir)..\") - - - Setup version from Git revision - - - echo Empty Action - - - Force build to run Pre-Build event - - - subversion.always.run - - - subversion.always.run - - - - - Level3 - Use - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - $(ProjectDir)../src/;$(ProjectDir)../public/;$(ProjectDir)../version/;$(ProjectDir)../include/;$(SolutionDir)../dep/rehlsdk/common/;$(SolutionDir)../dep/rehlsdk/dlls/;$(SolutionDir)../dep/rehlsdk/engine/;$(SolutionDir)../dep/rehlsdk/public/;$(SolutionDir)../dep/silk/include/;$(SolutionDir)../dep/opus/include/;$(SolutionDir)../dep/speex/include/;$(SolutionDir)../dep/metamod/;%(AdditionalIncludeDirectories) - precompiled.h - - - Windows - true - true - true - ws2_32.lib;%(AdditionalDependencies) - revoice.def - - - IF EXIST "$(ProjectDir)PreBuild.bat" (CALL "$(ProjectDir)PreBuild.bat" "$(ProjectDir)..\version\" "$(ProjectDir)..\") - - - Setup version from Git revision - - - IF EXIST "$(ProjectDir)PostBuild.bat" (CALL "$(ProjectDir)PostBuild.bat" "$(TargetDir)" "$(TargetName)" "$(TargetExt)" "$(ProjectDir)") - - - Automatic deployment script - - - echo Empty Action - - - Force build to run Pre-Build event - - - subversion.always.run - - - subversion.always.run - - - - - - \ No newline at end of file diff --git a/revoice/msvc/revoice.vcxproj.filters b/revoice/msvc/revoice.vcxproj.filters deleted file mode 100644 index 51b6791..0000000 --- a/revoice/msvc/revoice.vcxproj.filters +++ /dev/null @@ -1,193 +0,0 @@ - - - - - {b1350c2a-0971-49c7-a457-191a0dbb78e2} - - - {9d6a6444-3b04-4610-98da-2910f2e12975} - - - {2a5fb3db-9e29-48b6-8700-dce875791baf} - - - {3b33f11d-6bb6-40ed-8d55-a1609f01adeb} - - - {91057668-b802-4bd5-913c-b79adf8bff09} - - - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - include - - - src - - - src - - - src - - - public - - - public - - - public - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - public - - - src - - - - version - - - src - - - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - public - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - src - - - version - - - src - - - - - - version - - - gradle - - - - - - \ No newline at end of file diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 804a30b..0000000 --- a/settings.gradle +++ /dev/null @@ -1,5 +0,0 @@ -rootProject.name = 'revoice' -include 'revoice' -include 'dep/opus' -include 'dep/silk' -include 'dep/speex' diff --git a/shared.gradle b/shared.gradle deleted file mode 100644 index 107161f..0000000 --- a/shared.gradle +++ /dev/null @@ -1,44 +0,0 @@ -import org.doomedsociety.gradlecpp.cfg.BinaryKind -import org.doomedsociety.gradlecpp.toolchain.icc.Icc -import org.gradle.nativeplatform.NativeBinarySpec -import org.gradle.nativeplatform.NativeExecutableBinarySpec -import org.gradle.nativeplatform.SharedLibraryBinarySpec -import org.gradle.nativeplatform.StaticLibraryBinarySpec -import org.gradle.nativeplatform.toolchain.VisualCpp - -apply from: 'shared_msvc.gradle' -apply from: 'shared_icc.gradle' - -rootProject.ext.createToolchainConfig = { NativeBinarySpec bin -> - BinaryKind binaryKind - if (bin instanceof NativeExecutableBinarySpec) - { - binaryKind = BinaryKind.EXECUTABLE - } - else if (bin instanceof SharedLibraryBinarySpec) - { - binaryKind = BinaryKind.SHARED_LIBRARY - } - else if (bin instanceof StaticLibraryBinarySpec) - { - binaryKind = BinaryKind.STATIC_LIBRARY - } - else - { - throw new RuntimeException("Unknown executable kind ${bin.class.name}") - } - - boolean releaseBuild = bin.buildType.name.toLowerCase() == 'release' - if (bin.toolChain instanceof VisualCpp) - { - return rootProject.createMsvcConfig(releaseBuild, binaryKind) - } - else if (bin.toolChain instanceof Icc) - { - return rootProject.createIccConfig(releaseBuild, binaryKind) - } - else - { - throw new RuntimeException("Unknown native toolchain: ${bin.toolChain.class.name}") - } -} diff --git a/shared_icc.gradle b/shared_icc.gradle deleted file mode 100644 index 6244385..0000000 --- a/shared_icc.gradle +++ /dev/null @@ -1,65 +0,0 @@ -import org.doomedsociety.gradlecpp.cfg.BinaryKind -import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig -import org.doomedsociety.gradlecpp.gcc.OptimizationLevel - -rootProject.ext.createIccConfig = { boolean release, BinaryKind binKind -> - GccToolchainConfig cfg - if (release) { - cfg = new GccToolchainConfig( - compilerOptions: new GccToolchainConfig.CompilerOptions( - optimizationLevel: OptimizationLevel.LEVEL_3, - stackProtector: false, - interProceduralOptimizations: true, // -ipo - - noBuiltIn: true, - - intelExtensions: false, - asmBlocks: true, - - positionIndependentCode: false, - - extraDefines: [ - '_GLIBCXX_USE_CXX11_ABI': 0, // don't use specific c++11 features from GCC 5.X for backward compatibility to earlier version ABI libstdc++.so.6 - ] - ), - linkerOptions: new GccToolchainConfig.LinkerOptions( - interProceduralOptimizations: true, // -ipo - stripSymbolTable: true, - staticLibStdCpp: false, - staticLibGcc: false, - staticIntel: true, - ), - librarianOptions: new GccToolchainConfig.LibrarianOptions( - ) - ) - } else { - //debug - cfg = new GccToolchainConfig( - compilerOptions: new GccToolchainConfig.CompilerOptions( - optimizationLevel: OptimizationLevel.DISABLE, - stackProtector: true, - interProceduralOptimizations: false, - - noBuiltIn: true, - intelExtensions: false, - asmBlocks: true, - - extraDefines: [ - '_ITERATOR_DEBUG_LEVEL': 0, // for std::list, disable debug iterator in debug mode - '_GLIBCXX_USE_CXX11_ABI': 0, // don't use specific c++11 features from GCC 5.X for backward compatibility to earlier version ABI libstdc++.so.6 - ] - ), - linkerOptions: new GccToolchainConfig.LinkerOptions( - interProceduralOptimizations: false, - stripSymbolTable: false, - staticLibStdCpp: false, - staticLibGcc: false, - staticIntel: true, - ), - librarianOptions: new GccToolchainConfig.LibrarianOptions( - ) - ) - } - - return cfg -} diff --git a/shared_msvc.gradle b/shared_msvc.gradle deleted file mode 100644 index dc0125a..0000000 --- a/shared_msvc.gradle +++ /dev/null @@ -1,134 +0,0 @@ -import org.doomedsociety.gradlecpp.cfg.BinaryKind -import org.doomedsociety.gradlecpp.msvc.CallingConvention -import org.doomedsociety.gradlecpp.msvc.CodeGenerationKind -import org.doomedsociety.gradlecpp.msvc.CppExceptions -import org.doomedsociety.gradlecpp.msvc.DebugInfoFormat -import org.doomedsociety.gradlecpp.msvc.EnhancedInstructionsSet -import org.doomedsociety.gradlecpp.msvc.ErrorReporting -import org.doomedsociety.gradlecpp.msvc.FloatingPointModel -import org.doomedsociety.gradlecpp.msvc.LinkTimeCodeGenKind -import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig -import org.doomedsociety.gradlecpp.msvc.OptimizationLevel -import org.doomedsociety.gradlecpp.msvc.RuntimeChecks -import org.doomedsociety.gradlecpp.msvc.WarningLevel - -rootProject.ext.createMsvcConfig = { boolean release, BinaryKind binKind -> - MsvcToolchainConfig cfg - if (release) { - cfg = new MsvcToolchainConfig( - compilerOptions: new MsvcToolchainConfig.CompilerOptions( - codeGeneration: CodeGenerationKind.MULTITHREADED, - optimizationLevel: OptimizationLevel.FULL_OPTIMIZATION, - debugInfoFormat: DebugInfoFormat.PROGRAM_DATABASE, - runtimeChecks: RuntimeChecks.DEFAULT, - cppExceptions: CppExceptions.DISABLED, - warningLevel: WarningLevel.LEVEL_3, - callingConvention: CallingConvention.CDECL, - enhancedInstructionsSet: EnhancedInstructionsSet.SSE2, - floatingPointModel: FloatingPointModel.FAST, - - enableMinimalRebuild: false, - omitFramePointers: true, - wholeProgramOptimization: true, - enabledFunctionLevelLinking: true, - enableSecurityCheck: false, - analyzeCode: false, - sdlChecks: false, - treatWarningsAsErrors: false, - treatWchartAsBuiltin: true, - forceConformanceInForLoopScope: true, - - extraDefines: [ - 'WIN32': null, - '_MBCS': null, - 'NDEBUG': null, - ] - ), - linkerOptions: new MsvcToolchainConfig.LinkerOptions( - linkTimeCodeGenKind: LinkTimeCodeGenKind.USE_LTCG, - errorReportingMode: ErrorReporting.NO_ERROR_REPORT, - - enableIncrementalLinking: false, - eliminateUnusedRefs: true, - enableCOMDATFolding: true, - generateDebugInfo: true, - dataExecutionPrevention: true, - randomizedBaseAddress: true, - ), - librarianOptions: new MsvcToolchainConfig.LibrarianOptions( - linkTimeCodeGenKind: LinkTimeCodeGenKind.USE_LTCG - ), - generatePdb: true - ) - } else { - //debug - cfg = new MsvcToolchainConfig( - compilerOptions: new MsvcToolchainConfig.CompilerOptions( - codeGeneration: CodeGenerationKind.MULTITHREADED_DEBUG, - optimizationLevel: OptimizationLevel.DISABLED, - debugInfoFormat: DebugInfoFormat.PROGRAM_DATABASE, - runtimeChecks: RuntimeChecks.DEFAULT, - cppExceptions: CppExceptions.ENABLED_WITH_SEH, - warningLevel: WarningLevel.LEVEL_3, - callingConvention: CallingConvention.CDECL, - enhancedInstructionsSet: EnhancedInstructionsSet.SSE2, - floatingPointModel: FloatingPointModel.FAST, - - enableMinimalRebuild: true, - omitFramePointers: false, - wholeProgramOptimization: false, - enabledFunctionLevelLinking: true, - enableSecurityCheck: true, - analyzeCode: false, - sdlChecks: false, - treatWarningsAsErrors: false, - treatWchartAsBuiltin: true, - forceConformanceInForLoopScope: true, - - extraDefines: [ - 'WIN32': null, - '_MBCS': null, - '_DEBUG': null, - ] - ), - linkerOptions: new MsvcToolchainConfig.LinkerOptions( - linkTimeCodeGenKind: LinkTimeCodeGenKind.DEFAULT, - errorReportingMode: ErrorReporting.NO_ERROR_REPORT, - - enableIncrementalLinking: true, - eliminateUnusedRefs: false, - enableCOMDATFolding: false, - generateDebugInfo: true, - dataExecutionPrevention: true, - randomizedBaseAddress: true - ), - librarianOptions: new MsvcToolchainConfig.LibrarianOptions( - linkTimeCodeGenKind: LinkTimeCodeGenKind.USE_LTCG - ), - generatePdb: true - ) - - if (binKind == BinaryKind.STATIC_LIBRARY) { - cfg.compilerConfig.extraDefines['_LIB'] = null - } - } - - // Detect and setup UCRT paths - def ucrtInfo = "getucrtinfo.bat".execute().text - def m = ucrtInfo =~ /^(.*)\r\n(.*)?$/ - if (!m.find()) { - return cfg - } - - def kitPath = m.group(1) - def ucrtVersion = m.group(2) - def ucrtCheckFile = new File("${kitPath}Include/${ucrtVersion}/ucrt/stdio.h"); - if (!ucrtCheckFile.exists()) { - return cfg - } - - cfg.compilerOptions.args "/FS", "/I${kitPath}Include/${ucrtVersion}/ucrt"; - cfg.linkerOptions.args("/LIBPATH:${kitPath}Lib/${ucrtVersion}/ucrt/x86"); - - return cfg -}