diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-03-25 00:19:26 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-03-25 00:24:07 +0300 |
commit | f1d8aaf9bd9c8f6e8a0907422a34c023d527f13f (patch) | |
tree | 71a420b87fe6057b895fd1f79f98081f3cae3c99 /project/cmake/build.py | |
parent | project.ci: GitHub Actions no longer has pre-built Boost (diff) | |
download | cmake-common-f1d8aaf9bd9c8f6e8a0907422a34c023d527f13f.tar.gz cmake-common-f1d8aaf9bd9c8f6e8a0907422a34c023d527f13f.zip |
project.cmake.build: -H must be at the end
Older CMake versions don't like it when it's not the last argument.
Diffstat (limited to '')
-rw-r--r-- | project/cmake/build.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/project/cmake/build.py b/project/cmake/build.py index 20c823f..cb2e4cb 100644 --- a/project/cmake/build.py +++ b/project/cmake/build.py @@ -77,6 +77,8 @@ class GenerationPhase: result += self.configuration.cmake_args() result += self._cmake_boost_args() result += self.cmake_args + # Important! -H must come as the last parameter, older CMake versions + # don't like it when it's not. result += self._cmake_dir_args() return result @@ -92,12 +94,15 @@ class GenerationPhase: ] def _cmake_dir_args(self): - args = [ + args = [] + if self.install_dir is not None: + args += ['-D', f'CMAKE_INSTALL_PREFIX={self.install_dir}'] + # Important! -H must come as the last parameter, older CMake versions + # don't like it when it's not. + args += [ f'-B{self.build_dir}', f'-H{self.src_dir}' ] - if self.install_dir is not None: - args += ['-D', f'CMAKE_INSTALL_PREFIX={self.install_dir}'] return args def run(self, toolchain): |