我为一些使用 Ncurses 的项目创建了一个 Ncurses conan 包。我使用 conanfile.py 进行配置。现在我有一个问题,在 Centos 下,terminfo 在 /usr/lib 下,而在基于 Debian 的系统下,它在 /lib 下。
因此,我必须根据分布在 conanfile.py 中设置一个参数:
.
.
.
settings = "os", "compiler", "build_type", "arch"
.
.
.
def build(self):
env_build = AutoToolsBuildEnvironment(self)
env_build.configure(configure_dir="src", build=False, host=False, target=False)
args = ["--without-debug"]
# if debian-based
args += ["--datadir=/lib"]
if self.options.shared:
args += ["--with-shared", "--without-normal"]
env_build.configure(configure_dir="src", args=args, build=False, host=False, target=False)
env_build.make()
如何实现 if 语句# if debian-based
?在这种情况下,最佳做法是什么?