Page MenuHomePhabricator

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

Authored by Fabien on Nov 29 2019, 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
Branch
cmake_fix_remove_flag_scope
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 8336
Build 14691: Default Diff Build & Tests
Build 14690: arc lint + arc unit

Event Timeline

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)

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