Correctly test whether CC/CXX/FC env-vars are set in cmake toolchain config

This commit is contained in:
Sandro Mani 2022-01-08 19:33:47 +01:00
parent ea5c8fc32e
commit f9b54363f1
3 changed files with 10 additions and 8 deletions

View File

@ -6,7 +6,7 @@
%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
Name: mingw-filesystem
Version: 126
Version: 127
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
* Sat Jan 08 2022 Sandro Mani <manisandro@gmail.com> - 127-1
- Correctly test whether CC/CXX/FC env-vars are set in cmake toolchain config
* 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

View File

@ -2,13 +2,13 @@ SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_SYSTEM_PROCESSOR x86)
# specify the cross compiler
IF(NOT $ENV{CC})
IF(NOT DEFINED ENV{CC})
SET(CMAKE_C_COMPILER /usr/bin/i686-w64-mingw32-gcc)
ENDIF()
IF(NOT $ENV{CXX})
IF(NOT DEFINED ENV{CXX})
SET(CMAKE_CXX_COMPILER /usr/bin/i686-w64-mingw32-g++)
ENDIF()
IF(NOT $ENV{FC})
IF(NOT DEFINED ENV{FC})
SET(CMAKE_Fortran_COMPILER /usr/bin/i686-w64-mingw32-gfortran)
ENDIF()

View File

@ -1,14 +1,13 @@
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_SYSTEM_PROCESSOR x86_64)
# specify the cross compiler
IF(NOT $ENV{CC})
IF(NOT DEFINED ENV{CC})
SET(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32-gcc)
ENDIF()
IF(NOT $ENV{CXX})
IF(NOT DEFINED ENV{CXX})
SET(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++)
ENDIF()
IF(NOT $ENV{FC})
IF(NOT DEFINED ENV{FC})
SET(CMAKE_Fortran_COMPILER /usr/bin/x86_64-w64-mingw32-gfortran)
ENDIF()