I do like "target_compile_options()" up until the part that reads "If the use of the feature requires an additional compiler flag, such as -std=gnu++11, the flag will be added automatically." Don't change my toolchain flags for me, just error and exit :(
-
-
-
You surely mean target_compile_features - I think it's ok especially for the cxx_std_* features because that's basically the way how you add those --std=* compile flags isn't it?
-
Yeah I meant feature. And yes I do think you shouldn't change architecture/abi/toolchain flags through CMake checks.
-
But all those commands aren't checks. target_include_directories commands cmake to add the param that sets the include dirs. target_compile_definitions is a command to set the defines, not a check whether they are set. target_compile_features is a command to set the needed flags.
-
it would be inconsistent to make target_compile_feature a ckeck. To my knowledge, we can look if something is in CMAKE_CXX_COMPILE_FEATURES similar, as we do when we check for compiler versions and the like. That would be the usual way to _check_ something imo.
-
In that case I'd avoid the command altogether. It's like "target_compile_options()", some of the flags you can pass to it are safe but others aren't and CMake can't tell the difference and stop you :(
-
Yes it is. I'd either use it only with a standard version, i.e. not with a single feature, or set the standard globally because ABI
-
Or even better: toolchain files :D
- 1টি আরও উত্তর
নতুন কথা-বার্তা -
লোড হতে বেশ কিছুক্ষণ সময় নিচ্ছে।
টুইটার তার ক্ষমতার বাইরে চলে গেছে বা কোনো সাময়িক সমস্যার সম্মুখীন হয়েছে আবার চেষ্টা করুন বা আরও তথ্যের জন্য টুইটারের স্থিতি দেখুন।