![]() I would have expected the cmake command to recognize that qcc supports the -std=c++14 option and generates the corresponding command lines because of the CMAKE_CXX_STANDARD setting. ![]() fPIC -o CMakeFiles/shm_transfer.dir/src/ -c. SharedMemoryTransfer.cppĪs opposed to the command line using qcc toolchain. And yes, C++ revision N is mostly backwards-compatible with C++ revision N-1. Although while youre at it, general advice is to add the compiler flags to your command line. ![]() This property specifies the C++ standard whose features are requested to build this target. In your case the latter is probably sufficient as your codesnippet has a fallback if the c++ version is older. fPIC -std=gnu++14 -o CMakeFiles/shm_transfer.dir/src/ -c. That -stdc++11 flag was just a copy/paste bug. The C++ standard whose features are requested to build this target. settargetproperties(yourtargetname PROPERTIES CXXSTANDARD 17) if you just wish to use the newer version if it is available. make VERBOSE=1 displays the following command line (I removed some directories): /usr/local/bin/c++ -Dshm_transfer_EXPORTS -I. ![]() Running qcc manually it accepts the -std=c++14 option just fine and the code using std::make_unique compiles just fine.Īlso using the native compiler (Ubuntu 18.04, gcc) everything work fine with cmake generated makefiles. When I'm using check_cxx_compiler_flag feature, it seems to recognize the option: include(CheckCXXCompilerFlag)Ĭheck_cxx_compiler_flag(-std=c++14 CXX14_SUPPORT) Target_compile_features no known features for CXX compiler cmakeminimumrequired(VERSION 3.0) project(First VERSION 1.2.3) project(Second VERSION 3.4.5) addsubdirectory(sub) project(Third VERSION 6.7. I've tried using target compile features: target_compile_features(my_library PRIVATE cxx_std_14)īut that gives me the following error: CMake Error at CMakeLists.txt:53 (target_compile_features): In CMakeLists.txt file I specified CMAKE_CXX_STANDARD 14 required, but the resulting compiler command line does not contain the -std=c++14 option. I'm trying to cross compile some c++ library for QNX neutrino using cmake. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |