diff mbox series

[v6,2/4] pkg-cmake: add note on BUILD_STATIC_LIBS

Message ID 1515068911-21112-3-git-send-email-heyleke@gmail.com
State Accepted
Headers show
Series Opentracing-cpp: new package | expand

Commit Message

Jan Heylen Jan. 4, 2018, 12:28 p.m. UTC
From: Jan Heylen <jan.heylen@nokia.com>

as BUILD_STATIC_LIBS is not a standard cmake variable (while BUILD_SHARED_LIBS is)
we shouldn't add it in pkg-cmake.mk, although for some packages that would
make sense. Therefore, add a note so we don't forget about this abnormality.

see: https://cmake.org/cmake/help/v3.8/manual/cmake-variables.7.html#variables-that-change-behavior
Signed-off-by: Jan Heylen <jan.heylen@nokia.com>
---
 package/pkg-cmake.mk | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Thomas Petazzoni Jan. 7, 2018, 10:45 p.m. UTC | #1
Hello,

On Thu,  4 Jan 2018 13:28:29 +0100, Jan Heylen wrote:

> +#
> +# Note:
> +# BUILD_SHARED_LIBS is a cmake internal variable,
> +# BUILD_STATIC_LIBS is not standard in any way, which means some
> +# projects may choose another name for a similar option and there is not
> +# much we can do about this.
> +# see: https://cmake.org/cmake/help/v3.8/manual/cmake-variables.7.html#variables-that-change-behavior
> +#

I've applied, after rewording this a bit differently:

+#
+# - We are passing BUILD_SHARED_LIBS because it is documented as a
+#   standard CMake variable to control the build of shared libraries
+#   (see https://cmake.org/cmake/help/v3.8/manual/cmake-variables.7.html#variables-that-change-behavior)
+# - We are not passing BUILD_STATIC_LIBS because it is *not*
+#   documented as a standard CMake variable. If a package supports it,
+#   it must handle it explicitly.
+#

Thanks!

Thomas
diff mbox series

Patch

diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index 6739704..b75cb98 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -80,6 +80,15 @@  ifndef $(2)_CONFIGURE_CMDS
 ifeq ($(4),target)
 
 # Configure package for target
+#
+# Note:
+# BUILD_SHARED_LIBS is a cmake internal variable,
+# BUILD_STATIC_LIBS is not standard in any way, which means some
+# projects may choose another name for a similar option and there is not
+# much we can do about this.
+# see: https://cmake.org/cmake/help/v3.8/manual/cmake-variables.7.html#variables-that-change-behavior
+#
+# So: we handle BUILD_SHARED_LIBS here, but BUILD_STATIC_LIBS must be handled per package
 define $(2)_CONFIGURE_CMDS
 	(mkdir -p $$($$(PKG)_BUILDDIR) && \
 	cd $$($$(PKG)_BUILDDIR) && \