diff options
author | Volker Weißmann <volker.weissmann@gmx.de> | 2023-05-02 18:39:16 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2023-05-13 11:18:11 +0300 |
commit | a8b144b71b0780c211a5ecfbafab1a5b3e07bcf0 (patch) | |
tree | c1d330f7c6f751ab4e77a9c3f851dffead05c5fd /mesonbuild | |
parent | 2699fd4b8a7330bb67f79c3254777167cae19b48 (diff) | |
download | meson-a8b144b71b0780c211a5ecfbafab1a5b3e07bcf0.zip meson-a8b144b71b0780c211a5ecfbafab1a5b3e07bcf0.tar.gz meson-a8b144b71b0780c211a5ecfbafab1a5b3e07bcf0.tar.bz2 |
Make `dependency('foo', static: true, method: 'cmake') link statically
Fixes #1709
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/dependencies/cmake.py | 1 | ||||
-rw-r--r-- | mesonbuild/dependencies/data/CMakeLists.txt | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/mesonbuild/dependencies/cmake.py b/mesonbuild/dependencies/cmake.py index b5ddd28..8827c9a 100644 --- a/mesonbuild/dependencies/cmake.py +++ b/mesonbuild/dependencies/cmake.py @@ -388,6 +388,7 @@ class CMakeDependency(ExternalDependency): cmake_opts += ['-DARCHS={}'.format(';'.join(self.cmakeinfo.archs))] cmake_opts += [f'-DVERSION={package_version}'] cmake_opts += ['-DCOMPS={}'.format(';'.join([x[0] for x in comp_mapped]))] + cmake_opts += [f'-DSTATIC={self.static}'] cmake_opts += args cmake_opts += self.traceparser.trace_args() cmake_opts += toolchain.get_cmake_args() diff --git a/mesonbuild/dependencies/data/CMakeLists.txt b/mesonbuild/dependencies/data/CMakeLists.txt index acbf6487..d682cb8 100644 --- a/mesonbuild/dependencies/data/CMakeLists.txt +++ b/mesonbuild/dependencies/data/CMakeLists.txt @@ -8,6 +8,10 @@ set(PACKAGE_FOUND FALSE) set(_packageName "${NAME}") string(TOUPPER "${_packageName}" PACKAGE_NAME) +if("${STATIC}" STREQUAL "True") + set("${NAME}_USE_STATIC_LIBS" "ON") +endif() + while(TRUE) if ("${VERSION}" STREQUAL "") find_package("${NAME}" QUIET COMPONENTS ${COMPS}) |