diff --git a/regamedll/build.gradle b/regamedll/build.gradle index 27c5cb5b..33900b66 100644 --- a/regamedll/build.gradle +++ b/regamedll/build.gradle @@ -165,9 +165,13 @@ void setupToolchain(NativeBinarySpec b) cfg.linkerOptions.args '-qno-opt-class-analysis' } + if (cfg.linkerOptions.staticLibStdCpp) { + cfg.singleDefines 'BUILD_STATIC_LIBSTDC' + } + cfg.compilerOptions.args '-g0', '-fno-rtti', '-fno-exceptions' cfg.projectLibpath(project, '/lib/linux32') - cfg.extraLibs 'dl', 'm', 'stdc++', 'aelf32' + cfg.extraLibs 'dl', 'm', 'aelf32' } if (GradleCppUtils.windows && !unitTestExecutable) { diff --git a/regamedll/regamedll/public_amalgamation.cpp b/regamedll/regamedll/public_amalgamation.cpp index 117a0875..f8867f72 100644 --- a/regamedll/regamedll/public_amalgamation.cpp +++ b/regamedll/regamedll/public_amalgamation.cpp @@ -28,4 +28,6 @@ #include "precompiled.h" +#ifndef BUILD_STATIC_LIBSTDC // don't include to build if build with static libstdc++ #include "stdc++compat.cpp" +#endif