rules_foreign_cc icon indicating copy to clipboard operation
rules_foreign_cc copied to clipboard

Allow cmake variable to be set to the empty string

Open bpsalomon opened this issue 2 years ago • 0 comments

The cmake() tules interprets an entry in the cache_entries dictionary with a value of "" as meaning that the key, as a cmake variable name, should be unset. I have a case where I need to actually set a cmake variable to "" because the target library's CMakeFiles.txt checks to see if a variable is set and if not sets it to its idea of a default. This change would allow the user of the cmake() rule to set a variable to "" by specifying the dictionary value as "".

This is working for me but I'm open to other approaches. I think it'd be better to instead remove the existing interpretation of "" and then add a new list to the cmake() rule that contains the variables to leave unset in the final set passed to cmake. This would probably break existing users, though.

bpsalomon avatar May 25 '23 14:05 bpsalomon