Convert build configuration to CMake args
(self)
| 39 | self._set_config_setting(config_settings) |
| 40 | |
| 41 | def get_cmake_args(self) -> List[str]: |
| 42 | """Convert build configuration to CMake args""" |
| 43 | cmake_args = [] |
| 44 | for field_name in [x.name for x in dataclasses.fields(self)]: |
| 45 | if field_name in ["use_system_libxgboost"]: |
| 46 | continue |
| 47 | cmake_option = field_name.upper() |
| 48 | cmake_value = "ON" if getattr(self, field_name) is True else "OFF" |
| 49 | cmake_args.append(f"-D{cmake_option}={cmake_value}") |
| 50 | return cmake_args |