Page MenuHomePhabricator

[CMAKE] Fix scope issue in the remove_<lang>_compiler_flags() functions

Authored by Fabien on Nov 29 2019, 16:15.



The CMAKE_<LANG>_FLAGS where not propagated to the parent scope.
The configuration specific variables were correctly scoped if a
configuration is defined, which is our default, but invalid if unset.

Test Plan
ninja check

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Nov 29 2019, 16:15
Herald added a reviewer: Restricted Project. · View Herald TranscriptNov 29 2019, 16:15
deadalnix requested changes to this revision.Nov 29 2019, 16:20

Considering every single assignation is done to the parent_scope, you know this should have been a macro and not a function.

This revision now requires changes to proceed.Nov 29 2019, 16:20
Fabien requested review of this revision.Nov 30 2019, 14:11

There is one (hidden) assignation, the BUILD_TYPE_FLAGS variable from string(TOUPPER "CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}" BUILD_TYPE_FLAGS)

deadalnix accepted this revision.Nov 30 2019, 17:51
This revision is now accepted and ready to land.Nov 30 2019, 17:51