Add a `CMAKE_TRY_COMPILE_NO_PLATFORM_VARIABLES` variable to tell `try_compile` not to pass platform variables to the test project. Issue: #23219