Page MenuHomePhabricator

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

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

Details

Summary

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

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

Event Timeline

Fabien created this revision.Fri, Nov 29, 16:15
Herald added a reviewer: Restricted Project. · View Herald TranscriptFri, Nov 29, 16:15
deadalnix requested changes to this revision.Fri, Nov 29, 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.Fri, Nov 29, 16:20
Fabien requested review of this revision.Sat, Nov 30, 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.Sat, Nov 30, 17:51
This revision is now accepted and ready to land.Sat, Nov 30, 17:51