cmake-utils.eclass: export CC/CXX/FC to environment, #542530
authorMaciej Mrozowski <reavertm@gentoo.org>
Wed, 2 Nov 2016 02:31:56 +0000 (03:31 +0100)
committerMichał Górny <mgorny@gentoo.org>
Sun, 27 Nov 2016 11:42:39 +0000 (12:42 +0100)
eclass/cmake-utils.eclass

index 1cf08cd48740d1ee1f138ec78f7ea5546fd8f52d..0528432d81eb463c5e93a2406a48ae81e105f259 100644 (file)
@@ -526,13 +526,13 @@ enable_cmake-utils_src_configure() {
 
        local toolchain_file=${BUILD_DIR}/gentoo_toolchain.cmake
        cat > ${toolchain_file} <<- _EOF_ || die
-               SET (CMAKE_C_COMPILER $(tc-getCC))
-               SET (CMAKE_CXX_COMPILER $(tc-getCXX))
-               SET (CMAKE_Fortran_COMPILER $(tc-getFC))
                SET (CMAKE_AR $(type -P $(tc-getAR)) CACHE FILEPATH "Archive manager" FORCE)
                SET (CMAKE_RANLIB $(type -P $(tc-getRANLIB)) CACHE FILEPATH "Archive index generator" FORCE)
        _EOF_
 
+       # Bug 542530, export those instead of setting paths in toolchain file
+       local -x CC=$(tc-getCC) CXX=$(tc-getCXX) FC=$(tc-getFC)
+
        if tc-is-cross-compiler; then
                local sysname
                case "${KERNEL:-linux}" in