Opened 8 years ago

Closed 8 years ago

#52970 closed defect (fixed)

cmake does not honor CC / CXX

Reported by: jeremyhu (Jeremy Huddleston Sequoia) Owned by: michaelld (Michael Dickens)
Priority: High Milestone:
Component: ports Version: 2.3.5
Keywords: Cc: mk@…
Port: cmake

Description

cmake does not honor CC and CXX set by MacPorts base. Note that CC is set to /usr/bin/clang and CXX is set to /usr/bin/clang++, but cmake ends up using the output of xcrun -f clang instead.

We should ensure that the xcrun wrappers are used and not the toolchain executables directly.

:debug:configure Environment: 
:debug:configure CC='/usr/bin/clang'
:debug:configure CC_PRINT_OPTIONS='YES'
:debug:configure CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_graphite2/graphite2/work/.CC_PRINT_OPTIONS'
:debug:configure CFLAGS='-pipe -Os'
:debug:configure CPATH='/opt/local/include'
:debug:configure CPPFLAGS='-isystem/opt/local/include'
:debug:configure CXX='/usr/bin/clang++'
:debug:configure CXXFLAGS='-pipe -Os -stdlib=libc++'
:debug:configure F77FLAGS='-m64'
:debug:configure F90FLAGS='-pipe -Os -m64'
:debug:configure FCFLAGS='-pipe -Os -m64'
:debug:configure FFLAGS='-pipe -Os'
:debug:configure INSTALL='/usr/bin/install -c'
:debug:configure LDFLAGS='-L/opt/local/lib -Wl,-headerpad_max_install_names'
:debug:configure LIBRARY_PATH='/opt/local/lib'
:debug:configure MACOSX_DEPLOYMENT_TARGET='10.12'
:debug:configure OBJC='/usr/bin/clang'
:debug:configure OBJCFLAGS='-pipe -Os'
:debug:configure OBJCXX='/usr/bin/clang++'
:debug:configure OBJCXXFLAGS='-pipe -Os -stdlib=libc++'
:info:configure Executing:  cd "/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_graphite2/graphite2/work/graphite2-1.3.9" && /opt/local/bin/cmake -DCMAKE_INSTALL_PREFIX=/opt/local -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_INSTALL_RPATH=/opt/local/lib -DCMAKE_INSTALL_NAME_DIR=/opt/local/lib -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_MODULE_PATH=/opt/local/share/cmake/Modules -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.12" -DCMAKE_OSX_SYSROOT="/" /opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_graphite2/graphite2/work/graphite2-1.3.9 
:debug:configure system:  cd "/opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_graphite2/graphite2/work/graphite2-1.3.9" && /opt/local/bin/cmake -DCMAKE_INSTALL_PREFIX=/opt/local -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_INSTALL_RPATH=/opt/local/lib -DCMAKE_INSTALL_NAME_DIR=/opt/local/lib -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_MODULE_PATH=/opt/local/share/cmake/Modules -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.12" -DCMAKE_OSX_SYSROOT="/" /opt/local/var/macports/build/_Users_jeremy_src_macports_macports-ports_graphics_graphite2/graphite2/work/graphite2-1.3.9 
:info:configure -- The C compiler identification is AppleClang XXXXXXXXXX
:info:configure -- The CXX compiler identification is AppleClang XXXXXXXXXX
:info:configure -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
:info:configure -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- works
:info:configure -- Detecting C compiler ABI info
:info:configure -- Detecting C compiler ABI info - done
:info:configure -- Detecting C compile features
:info:configure -- Detecting C compile features - done
:info:configure -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
:info:configure -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -- works

Change History (4)

comment:1 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Cc: mk@… added

comment:2 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)

This seems to be a cmake bug that upstream intends to not fix, but we should be able to deal with it in the cmake port groups with -DCMAKE_CXX_COMPILER=${configure.cxx} et al.

Last edited 8 years ago by jeremyhu (Jeremy Huddleston Sequoia) (previous) (diff)

comment:3 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)

comment:4 Changed 8 years ago by larryv (Lawrence Velázquez)

Resolution: fixed
Status: newclosed

In aa7974d7/macports-ports:

cmake-1.[01].tcl: Ensure that cmake based ports use the correct compiler

Fixes #52970

Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@…>
Tested-by: Jeremy Huddleston Sequoia <jeremyhu@…>

Note: See TracTickets for help on using tickets.