title: How to set compile features in cmake toolchain file for known custom compiler to use target_compile_features
body: <p>I have minimal <strong>hello world</strong> sample:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  #include &lt;string_view&gt;
  
  int main(int /*argc*/, char* /*argv*/ [])
  {
      using namespace std;
  
      string_view output_phrase("hello world");
  
      cout &lt;&lt; output_phrase &lt;&lt; endl;
  
      bool is_good = cout.good();
  
      int result = is_good ? EXIT_SUCCESS : EXIT_FAILURE;
      return result;
  }
  </code></pre>
  
  <p>So I create minimal <strong>CMakeLists.txt</strong> file:</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.14)
  project(01-1-hello-world CXX)
  add_executable(01-1-hello-world main.cxx)
  target_compile_features(01-1-hello-world PUBLIC cxx_std_17)
  </code></pre>
  
  <p>Now If I use known for CMake compiler all works as expected (like MSVC, clang++, g++). But if I try some <strong>custom compiler(based on clang)</strong> from some SDK with <strong>toolchain file</strong> cmake say:</p>
  
  <blockquote>
    <p>CMake Error at CMakeLists.txt:5 (target_compile_features):
     target_compile_features The compiler feature "cxx_std_17" is not known to
     CXX compiler</p>
    
    <p>"Clang"</p>
  </blockquote>
  
  <p>So I try to set <a href="https://cmake.org/cmake/help/latest/variable/CMAKE_CXX_COMPILE_FEATURES.html#variable:CMAKE_CXX_COMPILE_FEATURES" rel="nofollow noreferrer"><code>CMAKE_CXX_COMPILE_FEATURES</code></a> in my toolchain file</p>
  
  <pre><code>set(CMAKE_CXX_COMPILE_FEATURES cxx_std_17) # we know custom-clang have c++17 support
  </code></pre>
  
  <p>Also I try to set <a href="https://cmake.org/cmake/help/latest/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html" rel="nofollow noreferrer"><code>CMAKE_CXX_KNOWN_FEATURES</code></a> but nothing changes.
  How to make <code>target_compile_features(01-1-hello-world PUBLIC cxx_std_17)</code> works in toolchain file for cmake for custom compiler? Thanks in advance!</p>