-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Build
-
Fully Compatible
Problem statement doc: https://docs.google.com/document/d/1xpvQF_h65kJ0O0QUULwyAD5poWK4oKkX2ljM_9PowvM/edit
We need to solve three problems:
1. Create a flag that can be used in select statements to determine wether or not the build is linked dynamically. Currently we're using --dynamic_mode which cannot be queried from in bzl files.
2. cc_library propogates linked opts transitively. For example, if lib_a sets linkopt_123 and lib_b has a dynamic dependency on lib_a, lib_b will inherit linkopt123. This is not desired for dynamic linking and breaks current requirements that the codebase has.
3. Only build in a single mode. We don't want to compile any objects statically when the final result is dynamic, and we don't want to compile any objects dynamically when the final result is static.
This can be accomplished with cc_shared_library without replacing cc_library with a custom rule.