[arch-dev-public] RFC: Dropping -DCMAKE_BUILD_TYPE from packages using cmake
bruno.n.pagani at gmail.com
Tue Mar 13 10:23:07 UTC 2018
Le 11/03/2018 à 10:00, Antonio Rojas via arch-dev-public a écrit :
> El domingo, 11 de marzo de 2018 1:44:07 (CET) Eli Schwartz via arch-dev-public escribió:
>> This theoretically sounds like a fantastic idea, but I'm not really sure
>> what CMake's deal with build flags are in the first place. What is the
>> default build type, and does CMake even look at build flags from the
>> environment at all (at least in a sane manner)?
> This is very poorly documented, so you have to dig into the cmake code to figure it out. The default build type is None, which means CMAKE_C(XX)_FLAGS is used (see /usr/share/cmake-3.10/Modules/CMakeCInformation.cmake:117), whose value is taken from the environment C(XX)FLAGS (see /usr/share/cmake-3.10/Modules/CMakeCXXInformation.cmake:198). So yes, not setting CMAKE_BUILD_TYPE will simply use the build flags from C(XX)FLAGS. If you want to test yourself, run cmake with the -LAH flag and check the output for CMAKE_C(XX)_FLAGS.
Some projects seems to default to Debug instead of None… So should we
specify a BUILD_TYPE of None instead of Release?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 520 bytes
Desc: OpenPGP digital signature
More information about the arch-dev-public