Page MenuHomePhabricator

[CMAKE] Add an option to enable/disable hardening
ClosedPublic

Authored by Fabien on Mar 8 2019, 13:36.

Details

Summary

Tis mimics the --enable-hardening and --disable-hardening from
autotools. The default is to enable hardening.

Depends on D2653

Test Plan
mkdir buildcmake && cd buildcmake
cmake -GNinja ..
ninja -v

Check the -fPIE flags is added on the compile lines.
Check the -pie flag is added on the linker lines.

rm -rf *
cmake -GNinja .. -DENABLE_HARDENING=ON
ninja -v

Check the -fPIE flags is added on the compile lines.
Check the -pie flag is added on the linker lines.

rm -rf *
cmake -GNinja .. -DENABLE_HARDENING=OFF
ninja -v

Check the -fPIE flags is no longer on the compile lines.
Check the -pie flag is no longer on the linker lines.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Mar 8 2019, 21:25
This revision was automatically updated to reflect the committed changes.