HomePhabricator

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

Authored by Fabien on Thu, Aug 8, 14:29.

Description

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

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]

Reviewers: #bitcoin_abc, deadalnix, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D3825

Details

Committed
FabienSun, Aug 11, 08:05
Pushed
FabienSun, Aug 11, 08:05
Reviewer
Restricted Project
Differential Revision
D3825: [CMAKE] Fix -Wunused-command-line-argument when adding linker flag
Parents
rABC3584560a4b91: build: avoid getifaddrs when unavailable
Branches
Unknown
Tags
Unknown