From: Samuel Martin <s.martin49@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3 07/14] pkg-cmake.mk: export the fortran compiler path in the CMake toolchain file
Date: Sun, 3 Jul 2016 15:47:43 +0200 [thread overview]
Message-ID: <20160703134750.7516-8-s.martin49@gmail.com> (raw)
In-Reply-To: <20160703134750.7516-1-s.martin49@gmail.com>
Since the fortran support is conditional, only enable it when needed.
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Cc: Benjamin Kamath <bkamath@spaceflight.com>
---
changes v1->v2:
- set CMAKE_Fortran_FLAGS in the toolchainfile.cmake (Benjamin K.)
changes v2->v3:
- none
---
package/pkg-cmake.mk | 3 +++
support/misc/toolchainfile.cmake.in | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index 6f0ecf9..9291523 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -236,9 +236,12 @@ $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
-e 's#@@STAGING_SUBDIR@@#$(call qstrip,$(STAGING_SUBDIR))#' \
-e 's#@@TARGET_CFLAGS@@#$(call qstrip,$(TARGET_CFLAGS))#' \
-e 's#@@TARGET_CXXFLAGS@@#$(call qstrip,$(TARGET_CXXFLAGS))#' \
+ -e 's#@@TARGET_FCFLAGS@@#$(call qstrip,$(TARGET_FCFLAGS))#' \
-e 's#@@TARGET_LDFLAGS@@#$(call qstrip,$(TARGET_LDFLAGS))#' \
-e 's#@@TARGET_CC@@#$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_CC)))#' \
-e 's#@@TARGET_CXX@@#$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_CXX)))#' \
+ -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)#' \
$(TOPDIR)/support/misc/toolchainfile.cmake.in \
> $@
diff --git a/support/misc/toolchainfile.cmake.in b/support/misc/toolchainfile.cmake.in
index 5cf381e..e550b8f 100644
--- a/support/misc/toolchainfile.cmake.in
+++ b/support/misc/toolchainfile.cmake.in
@@ -29,3 +29,7 @@ set(ENV{PKG_CONFIG_SYSROOT_DIR} "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@")
# This toolchain file can be used both inside and outside Buildroot.
set(CMAKE_C_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_CC@@")
set(CMAKE_CXX_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_CXX@@")
+if(@@TOOLCHAIN_HAS_FORTRAN@@)
+ set(CMAKE_Fortran_FLAGS "@@TARGET_FCFLAGS@@ ${CMAKE_Fortran_FLAGS}" CACHE STRING "Buildroot FCFLAGS")
+ set(CMAKE_Fortran_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_FC@@")
+endif()
--
2.9.0
next prev parent reply other threads:[~2016-07-03 13:47 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-03 13:47 [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 01/14] toolchain/toolchain-common.in: add BR2_TOOLCHAIN_HAS_LIBQUADMATH hidden symbol Samuel Martin
2016-07-04 9:16 ` Arnout Vandecappelle
2016-07-04 14:22 ` Thomas Petazzoni
2016-07-03 13:47 ` [Buildroot] [PATCH v3 02/14] package/gcc: complete the logic on libquadmath Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 03/14] package/gcc: fix fortran support Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 04/14] toolchain: add hidden symbol for fortran support in the toolchain Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 05/14] docs/manual: document dependency on fortran Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 06/14] package/gcc: select BR2_TOOLCHAIN_HAS_FORTRAN when appropriate Samuel Martin
2016-07-03 13:47 ` Samuel Martin [this message]
2016-07-03 13:47 ` [Buildroot] [PATCH v3 08/14] toolchain/helpers: add fortran check Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 09/14] toolchain/toolchain-external: enable fortran check when it is selected Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 10/14] toolchain/toolchain-external: add libgfortran and libquadmath to the TOOLCHAIN_EXTERNAL_LIBS list Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 11/14] toolchain/toolchain-external: add knob for fortran support Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 12/14] toolchain/toolchain-external: update external toolchain configuration with BR2_TOOLCHAIN_HAS_FORTRAN Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 13/14] package/fftw: add fortran support Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 14/14] package/lapack: new package Samuel Martin
2016-07-03 15:02 ` [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Thomas Petazzoni
2016-07-04 22:56 ` Samuel Martin
2016-07-05 6:33 ` Thomas Petazzoni
2016-07-05 6:48 ` 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=20160703134750.7516-8-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