# that will inspect CMAKE_C*_STANDARD_HAS_FULL_SUPPORT variables # will define cmake_record_c_compile_features macro Set(CMAKE_C11_STANDARD_HAS_FULL_SUPPORT ON) Set(CMAKE_C90_STANDARD_HAS_FULL_SUPPORT ON) cat > toolchain-sdcc.cmake CMakeLists.txt toolchain-sdcc.cmake toolchain-sdcc.cmake <<EOF What is the meaning of variables can be deduced from their names. For C because it's simpler, it's exactly the same for C++ it's similar with CXX* variables. ).įor reference for feature readers and because cmake uses a lot of global variables, I want to post what is working with sdcc compiler for C language. Note that CMAKE_*_KNOWN_FEATURES is a list of features, o use list(APPEND CMAKE_CXX_COMPILE_FEATURES. You have to remove the build files compleatly and reconfigure cmake when making modifications to the toolchain file. Variables in toolchain file are not "refreshed" when you re-run cmake. You most probably forgot to clear your build tree. How to make target_compile_features(01-1-hello-world PUBLIC cxx_std_17) works in toolchain file for cmake for custom compiler? Thanks in advance!Īlso I try to set CMAKE_CXX_KNOWN_FEATURES So I try to set CMAKE_CXX_COMPILE_FEATURES in my toolchain file set(CMAKE_CXX_COMPILE_FEATURES cxx_std_17) # we know custom-clang have c++17 supportĪlso I try to set CMAKE_CXX_KNOWN_FEATURES but nothing changes. Target_compile_features The compiler feature "cxx_std_17" is not known to But if I try some custom compiler(based on clang) from some SDK with toolchain file cmake say:ĬMake Error at CMakeLists.txt:5 (target_compile_features): Now If I use known for CMake compiler all works as expected (like MSVC, clang++, g++). Target_compile_features(01-1-hello-world PUBLIC cxx_std_17) So I create minimal CMakeLists.txt file: cmake_minimum_required(VERSION 3.14)Īdd_executable(01-1-hello-world main.cxx) Int result = is_good ? EXIT_SUCCESS : EXIT_FAILURE String_view output_phrase("hello world") I have minimal hello world sample: #include
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |