diff --git a/build/gen.py b/build/gen.py index ee4f8e14..89714678 100755 --- a/build/gen.py +++ b/build/gen.py @@ -332,8 +332,11 @@ def WriteGNNinja(path, platform, host, options): ldflags.extend(['-maix64', '-pthread']) if options.use_lto: - cflags.extend(['-flto', '-fwhole-program-vtables']) - ldflags.extend(['-flto', '-fwhole-program-vtables']) + cflags.append('-flto') + ldflags.append('-flto') + if "clang" in cc: + cflags.append('-fwhole-program-vtables') + ldflags.append('-fwhole-program-vtables') elif platform.is_msvc(): if not options.debug: