Preserve CC/CXX/FC/RC set by ENV if set in cmake toolchain files

This commit is contained in:
Sandro Mani 2021-12-15 22:21:47 +01:00
parent e2f6d80752
commit ea5c8fc32e
3 changed files with 28 additions and 9 deletions

View File

@ -6,7 +6,7 @@
%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
Name: mingw-filesystem
Version: 125
Version: 126
Release: 1%{?dist}
Summary: MinGW cross compiler base filesystem and environment
@ -358,6 +358,9 @@ echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/x86_64-w64-mingw32-pkg-c
%changelog
* Wed Dec 15 2021 Sandro Mani <manisandro@gmail.com> - 126-1
- Preserve CC/CXX/FC/RC set by ENV if set in cmake toolchain files
* Sat Nov 20 2021 Sandro Mani <manisandro@gmail.com> - 125-1
- Fix up debug dirs ownership

View File

@ -2,8 +2,15 @@ SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_SYSTEM_PROCESSOR x86)
# specify the cross compiler
SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
IF(NOT $ENV{CC})
SET(CMAKE_C_COMPILER /usr/bin/i686-w64-mingw32-gcc)
ENDIF()
IF(NOT $ENV{CXX})
SET(CMAKE_CXX_COMPILER /usr/bin/i686-w64-mingw32-g++)
ENDIF()
IF(NOT $ENV{FC})
SET(CMAKE_Fortran_COMPILER /usr/bin/i686-w64-mingw32-gfortran)
ENDIF()
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32/sys-root/mingw)
@ -18,10 +25,11 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET(QT_BINARY_DIR /usr/i686-w64-mingw32/bin /usr/bin)
# set the resource compiler (RHBZ #652435)
SET(CMAKE_RC_COMPILER /usr/bin/i686-w64-mingw32-windres)
IF(NOT $ENV{RC})
SET(CMAKE_RC_COMPILER /usr/bin/i686-w64-mingw32-windres)
ENDIF()
# These are needed for compiling lapack (RHBZ #753906)
SET(CMAKE_Fortran_COMPILER i686-w64-mingw32-gfortran)
SET(CMAKE_AR:FILEPATH /usr/bin/i686-w64-mingw32-ar)
SET(CMAKE_RANLIB:FILEPATH /usr/bin/i686-w64-mingw32-ranlib)

View File

@ -2,8 +2,15 @@ SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_SYSTEM_PROCESSOR x86_64)
# specify the cross compiler
SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
IF(NOT $ENV{CC})
SET(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32-gcc)
ENDIF()
IF(NOT $ENV{CXX})
SET(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++)
ENDIF()
IF(NOT $ENV{FC})
SET(CMAKE_Fortran_COMPILER /usr/bin/x86_64-w64-mingw32-gfortran)
ENDIF()
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32/sys-root/mingw)
@ -18,10 +25,11 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET(QT_BINARY_DIR /usr/x86_64-w64-mingw32/bin /usr/bin)
# set the resource compiler (RHBZ #652435)
SET(CMAKE_RC_COMPILER /usr/bin/x86_64-w64-mingw32-windres)
IF(NOT $ENV{RC})
SET(CMAKE_RC_COMPILER /usr/bin/x86_64-w64-mingw32-windres)
ENDIF()
# These are needed for compiling lapack (RHBZ #753906)
SET(CMAKE_Fortran_COMPILER x86_64-w64-mingw32-gfortran)
SET(CMAKE_AR:FILEPATH /usr/bin/x86_64-w64-mingw32-ar)
SET(CMAKE_RANLIB:FILEPATH /usr/bin/x86_64-w64-mingw32-ranlib)