diff mbox

[v2,2/5] package/pkg-cmake.mk: set the {C, CXX, LD}FLAGS for host packages

Message ID 1408653920-18954-3-git-send-email-s.martin49@gmail.com
State Accepted
Headers show

Commit Message

Samuel Martin Aug. 21, 2014, 8:45 p.m. UTC
Signed-off-by: Samuel Martin <s.martin49@gmail.com>

---
changes v1 -> v2:
- no change
---
 package/pkg-cmake.mk | 3 +++
 1 file changed, 3 insertions(+)

Comments

Yann E. MORIN Sept. 14, 2014, 4:27 p.m. UTC | #1
Samuel, All,

On 2014-08-21 22:45 +0200, Samuel Martin spake thusly:
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>

As I am not a cmake expert, I'd like a bit more explanations in the
commit log.

What puzzles me is that, for the target case, these flags are passed via
support/misc/toolchainfile.cmake.in, while for the host, we pass them on
the command line. This is not consistent.

Why don't we also use a host.cmake.in file like we have for the target?

Note that us having support/misc/toolchainfile.cmake.in does not even
help for building a cmake package outside of Buildroot (but still using
our toolchain), since the user may forget to define CMAKE_TOOLCHAIN_FILE
when calling cmake on his own.

Note: I know you have a good answer, but I'm a bit lost as to all those
special-casing in cmake, which makes reviewing a bit difficult, and a
bit of comments in the commit log (a pointer to the cmake doc would be
enough!) would make it easier.

Regards,
Yann E. MORIN.

> ---
> changes v1 -> v2:
> - no change
> ---
>  package/pkg-cmake.mk | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> index f5aefae..3655751 100644
> --- a/package/pkg-cmake.mk
> +++ b/package/pkg-cmake.mk
> @@ -86,6 +86,9 @@ define $(2)_CONFIGURE_CMDS
>  		-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY="BOTH" \
>  		-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE="BOTH" \
>  		-DCMAKE_INSTALL_PREFIX="$$(HOST_DIR)/usr" \
> +		-DCMAKE_C_FLAGS="$$(HOST_CFLAGS)" \
> +		-DCMAKE_CXX_FLAGS="$$(HOST_CXXFLAGS)" \
> +		-DCMAKE_EXE_LINKER_FLAGS="$$(HOST_LDFLAGS)" \
>  		-DBUILD_TESTING=OFF \
>  		$$($$(PKG)_CONF_OPT) \
>  	)
> -- 
> 2.1.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Peter Korsgaard Sept. 28, 2014, 6:52 p.m. UTC | #2
>>>>> "Samuel" == Samuel Martin <s.martin49@gmail.com> writes:

 > Signed-off-by: Samuel Martin <s.martin49@gmail.com>

Committed, thanks.

I do agree with Yann though that it would be good if the commit messages
were more detailed. Why do we use a toolchain files for target, but not
for host?
diff mbox

Patch

diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index f5aefae..3655751 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -86,6 +86,9 @@  define $(2)_CONFIGURE_CMDS
 		-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY="BOTH" \
 		-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE="BOTH" \
 		-DCMAKE_INSTALL_PREFIX="$$(HOST_DIR)/usr" \
+		-DCMAKE_C_FLAGS="$$(HOST_CFLAGS)" \
+		-DCMAKE_CXX_FLAGS="$$(HOST_CXXFLAGS)" \
+		-DCMAKE_EXE_LINKER_FLAGS="$$(HOST_LDFLAGS)" \
 		-DBUILD_TESTING=OFF \
 		$$($$(PKG)_CONF_OPT) \
 	)