![]() Is this functionality available in CMake? Iâm using 3.21.2. SET(CMAKE_C_COMPILER "/opt/rh/devtoolset-10/root/usr/bin/gcc")Īs the first lines in my root CMakeLists.txt, otherwise CMake tries to use the default GCC 4.8 shipped by CentOS. PS: Just in case is useful, Iâm defining the compiler to be used with the command: SET(CMAKE_CXX_COMPILER "/opt/rh/devtoolset-10/root/usr/bin/g++") Is there a way to tell CMake to treat all the compiler-added include directories as SYSTEM? I could add those directories by hand, like: target_include_directories(my_target SYSTEM PRIVATE /opt/rh/devtoolset-10/root/usr/include)Ä«ut I donât think thatâs an elegant and probably not even correct solution. opt/rh/devtoolset-10/root/usr/include/ is never explicitly added by my config files, but automatically detected by CMake instead. 1 2 molloydbeaglebone: sudo apt-get install git molloydbeaglebone: git clone Example 1: The Hello World Example The first project is contained in the extras/cmake/helloworld directory of the GitHub repository. This property holds a semicolon-separated list of paths and will be added to the list of include directories when this source file builds. Whether the flag has any effect or even a specific one is beyond the scope of this module. INCLUDEDIRECTORIES List of preprocessor include file search directories. A positive result from this check indicates only that the compiler did not issue a diagnostic message when given the flag. Stores the result in an internal cache entry named . opt/rh/devtoolset-10/root/usr/include/c++/10/pstl/pstl_config.h:47:5: error: "_clang_" is not defined, evaluates to 0 Ĭompilation terminated due to -Wfatal-errors.Ĭc1plus: all warnings being treated as errors Check that the is accepted by the compiler without a diagnostic.For example, in CentOS 7 using GCC 10, I canât enable -Wundef, since the system includes fail because of it: list(APPEND CXX_COMPILER_FLAGS_TO_USE "-Wundef")Ĭauses: In file included from /opt/rh/devtoolset-10/root/usr/include/c++/10/x86_64-redhat-linux/bits/c++config.h:2791,įrom /opt/rh/devtoolset-10/root/usr/include/c++/10/cmath:41, However, I canât figure out how to extend that behavior to system include directories. To avoid catching warnings coming from that library that could stop my compilation if I have those warnings defined as errors in my environment: list(APPEND CXX_COMPILER_FLAGS_TO_USE "-Werror") It will also ensure that the include directories of. ![]() In CMake, I know I can do target_include_directories(my_target SYSTEM PRIVATE $) It includes the necessary headers and libraries and their dependencies to be correctly found by the project.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |