Browse Source

Make C and C++ default dialect detection robust to advanced optimizations

In commit v3.4.0-rc1~71^2 (Project: Determine default language dialect
for the compiler, 2015-09-15) we added an "INFO:..." string to the
compiler id detection binary.  The value can be optimized out of the
compiler id binary unless we force it to be included by making the
program behavior depend on it at runtime.  Add references to the value
as we do for the other info strings already.

Gentoo-Issue: https://bugs.gentoo.org/show_bug.cgi?id=565744
pull/200/head
Brad King 10 years ago
parent
commit
c3dc8935ee
  1. 1
      Modules/CMakeCCompilerId.c.in
  2. 1
      Modules/CMakeCXXCompilerId.cpp.in

1
Modules/CMakeCCompilerId.c.in

@ -55,6 +55,7 @@ int main(int argc, char* argv[])
#ifdef SIMULATE_VERSION_MAJOR
require += info_simulate_version[argc];
#endif
require += info_language_dialect_default[argc];
(void)argv;
return require;
}

1
Modules/CMakeCXXCompilerId.cpp.in

@ -49,6 +49,7 @@ int main(int argc, char* argv[])
#ifdef SIMULATE_VERSION_MAJOR
require += info_simulate_version[argc];
#endif
require += info_language_dialect_default[argc];
(void)argv;
return require;
}
Loading…
Cancel
Save