Page MenuHomePhabricator

[CMAKE] Fix -Wunused-command-line-argument when adding linker flag
ClosedPublic

Authored by Fabien on Aug 8 2019, 14:39.

Details

Summary

The previous diff D3792 made the add_linker_flag method able to catch
unused link flags, preventing their addition.
The following diff D3802 broke the feature while refactoring the code.
Adding the warning is not enough, it should be promoted to an error.

This diff restores the previous (correct) behavior.

Test Plan
mkdir buildcmake_osx && cd buildcmake_osx
cmake -GNinja .. -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/OSX.cmake
ninja

Check the following warning disappeared with this patch:

clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]

Diff Detail

Repository
rABC Bitcoin ABC
Branch
cmake_restore_werror
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7080
Build 12206: Bitcoin ABC Buildbot (legacy)
Build 12205: arc lint + arc unit