[geos-devel] RFC7: Discontinue use of autotools

Sebastiaan Couwenberg sebastic at xs4all.nl
Sun Jan 10 20:38:34 PST 2021


On 1/11/21 2:37 AM, Daniel Baston wrote:
>>
>>> Have CMAKE_BUILD_TYPE=None define NDEBUG so that assert() is removed
>>>> from the code, thereby not storing the buildpath in the binaries helping
>>>> reproducible builds.
>>>>
>>>
>>> If you don't specify CMAKE_BUILD_TYPE it defaults to Release, and NDEBUG
>>> will be defined.
>>
>> But then -g is not used and there will be no debug symbols.
>> RelWithDebInfo is more what we need.
>>
>>> Do you mean that we should define a new build type called
>>> "None" ?
>>
>> It is used to have the buildflags set in the environment determine
>> optimization etc.
>>
> 
> Just to make sure I'm clear: we would have an explicitly specified
> CMAKE_BUILD_TYPE=None define NDEBUG and set no compiler flags? This is
> distinct from not specifying CMAKE_BUILD_TYPE, which gives you a Release
> build with its associated flags for optimizations/warnings/etc.

I would probably set NDEBUG when CMAKE_BUILD_TYPE != Release.

But the file-references-package-build-path issue is inherent to the
difference between CMake and Autotools. The Autotools build doesn't
strip assert() (which uses __FILE__) with NDEBUG, it uses a relative
path which doesn't include the build directory.

Adding NDEBUG for the CMake build is a workaround for its use of the
absolute path for __FILE__.

>> CMake apparently uses the absolute path for __FILE__ whereas Autotools
>> uses the path relative to the Makefile. Hence we get
>> file-references-package-build-path issues after switching a package to
>> use the cmake buildsystem.
>>
> 
> I've just removed our only usage of __FILE__ in a non-debug build.

Kind Regards,

Bas

-- 
 GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146  50D1 6750 F10A E88D 4AF1


More information about the geos-devel mailing list