mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-28 09:59:20 -05:00
try_compile: Honor CMAKE_WARN_DEPRECATED in test project
This causes the `-Wno-deprecated` option to be honored even inside a `try_compile` test project, which is needed to suppress all deprecation warnings as the option documents. Closes: #16446
This commit is contained in:
@@ -44,6 +44,7 @@ static std::string const kCMAKE_TRY_COMPILE_OSX_ARCHITECTURES =
|
||||
"CMAKE_TRY_COMPILE_OSX_ARCHITECTURES";
|
||||
static std::string const kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES =
|
||||
"CMAKE_TRY_COMPILE_PLATFORM_VARIABLES";
|
||||
static std::string const kCMAKE_WARN_DEPRECATED = "CMAKE_WARN_DEPRECATED";
|
||||
|
||||
int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
|
||||
bool isTryRun)
|
||||
@@ -453,6 +454,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
|
||||
vars.insert(kCMAKE_OSX_SYSROOT);
|
||||
vars.insert(kCMAKE_POSITION_INDEPENDENT_CODE);
|
||||
vars.insert(kCMAKE_SYSROOT);
|
||||
vars.insert(kCMAKE_WARN_DEPRECATED);
|
||||
|
||||
if (const char* varListStr = this->Makefile->GetDefinition(
|
||||
kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES)) {
|
||||
|
||||
Reference in New Issue
Block a user