Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Martin <s.martin49@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v4 2/9] package/pkg-cmake.mk: move CMAKE_BUILD_TYPE definition into toolchainfile.cmake
Date: Sat, 15 Oct 2016 22:31:16 +0200	[thread overview]
Message-ID: <20161015203123.11241-3-s.martin49@gmail.com> (raw)
In-Reply-To: <20161015203123.11241-1-s.martin49@gmail.com>

This change still allows overriding the build type from the configure
command line.

Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>

---
changes v3->v4:
- new patch
---
 CHANGES                             | 6 ++++++
 package/pkg-cmake.mk                | 2 +-
 support/misc/toolchainfile.cmake.in | 3 +++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/CHANGES b/CHANGES
index b4bd5fe..c0e3e79 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+2016.11-rc1,
+
+    toolchainfile.cmake:
+    * when used outside of Buildroot, if not specified on the command
+      line, the CMAKE_BUILD_TYPE is by toolchainfile.cmake.
+
 2016.08, Released September 1st, 2016
 
 	Minor fixes.
diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index 259865d..5725ed6 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -95,7 +95,6 @@ define $(2)_CONFIGURE_CMDS
 	PATH=$$(BR_PATH) \
 	$$($$(PKG)_CONF_ENV) $$(BR2_CMAKE) $$($$(PKG)_SRCDIR) \
 		-DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \
-		-DCMAKE_BUILD_TYPE=$(BR_CMAKE_BUILD_TYPE) \
 		-DCMAKE_INSTALL_PREFIX="/usr" \
 		-DCMAKE_COLOR_MAKEFILE=OFF \
 		-DBUILD_DOC=OFF \
@@ -255,5 +254,6 @@ $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
 		-e 's#@@TARGET_FC@@#$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_FC)))#' \
 		-e 's#@@CMAKE_SYSTEM_PROCESSOR@@#$(call qstrip,$(CMAKE_SYSTEM_PROCESSOR))#' \
 		-e 's#@@TOOLCHAIN_HAS_FORTRAN@@#$(if $(BR2_TOOLCHAIN_HAS_FORTRAN),1,0)#' \
+		-e 's#@@BR_CMAKE_BUILD_TYPE@@#$(BR_CMAKE_BUILD_TYPE)#' \
 		$(TOPDIR)/support/misc/toolchainfile.cmake.in \
 		> $@
diff --git a/support/misc/toolchainfile.cmake.in b/support/misc/toolchainfile.cmake.in
index 649b52d..b0a1cd9 100644
--- a/support/misc/toolchainfile.cmake.in
+++ b/support/misc/toolchainfile.cmake.in
@@ -13,6 +13,9 @@ string(REPLACE "/usr/share/buildroot" "" RELOCATED_HOST_DIR ${CMAKE_CURRENT_LIST
 set(CMAKE_SYSTEM_NAME Linux)
 set(CMAKE_SYSTEM_PROCESSOR @@CMAKE_SYSTEM_PROCESSOR@@)
 
+# Build type from the Buildroot configuration
+set(CMAKE_BUILD_TYPE @@BR_CMAKE_BUILD_TYPE@@ CACHE)
+
 set(CMAKE_C_FLAGS "@@TARGET_CFLAGS@@ ${CMAKE_C_FLAGS}" CACHE STRING "Buildroot CFLAGS")
 set(CMAKE_CXX_FLAGS "@@TARGET_CXXFLAGS@@ ${CMAKE_CXX_FLAGS}" CACHE STRING "Buildroot CXXFLAGS")
 set(CMAKE_EXE_LINKER_FLAGS "@@TARGET_LDFLAGS@@ ${CMAKE_EXE_LINKER_FLAGS}" CACHE STRING "Buildroot LDFLAGS")
-- 
2.10.0

  parent reply	other threads:[~2016-10-15 20:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-15 20:31 [Buildroot] [PATCH v4 0/9] Misc. CMake fixes Samuel Martin
2016-10-15 20:31 ` [Buildroot] [PATCH v4 1/9] package/pkg-cmake.mk: fix build type and optimization flags Samuel Martin
2016-10-15 20:31 ` Samuel Martin [this message]
2016-10-15 20:31 ` [Buildroot] [PATCH v4 3/9] toolchainfile.cmake: set per-config appended {C, CXX}FLAGS Samuel Martin
2016-10-15 20:31 ` [Buildroot] [PATCH v4 4/9] package/gflags: include TARGET_CXXFLAGS to the overloaded CXXFLAGS Samuel Martin
2016-10-15 20:31 ` [Buildroot] [PATCH v4 5/9] package/gnuradio: include TARGET_CFLAGS to the overloaded CFLAGS Samuel Martin
2016-10-15 20:31 ` [Buildroot] [PATCH v4 6/9] package/libcec: include TARGET_{C, CXX}FLAGS to the overloaded {C, CXX}FLAGS Samuel Martin
2016-10-15 20:31 ` [Buildroot] [PATCH v4 7/9] package/opencv3: fix CMAKE_CXX_FLAGS Samuel Martin
2016-10-15 20:31 ` [Buildroot] [PATCH v4 8/9] package/rpi-userland: include TARGET_CFLAGS to the overloaded CFLAGS Samuel Martin
2016-10-15 20:31 ` [Buildroot] [PATCH v4 9/9] toochainfile.cmake: rework the way Buildroot sets flags Samuel Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161015203123.11241-3-s.martin49@gmail.com \
    --to=s.martin49@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox