Ignore:
Timestamp:
Dec 22, 2015, 1:37:59 AM (3 years ago)
Author:
ryandesign@…
Message:

cmake-1.0.tcl: do not set -arch flags in the normal MacPorts variables because
this is unnecessary (cmake wants the architectures in CMAKE_OSX_ARCHITECTURES)
and (in the case of a universal build) harmful in that it prevents the compiler
from being identified (#48331)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/_resources/port1.0/group/cmake-1.0.tcl

    r135668 r143801  
    33#
    44# Copyright (c) 2009 Orville Bennett <illogical1 at gmail.com>
    5 # Copyright (c) 2010-2014 The MacPorts Project
     5# Copyright (c) 2010-2015 The MacPorts Project
    66# All rights reserved.
    77#
     
    118118                              -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG"
    119119    }
     120}
    120121
    121     platform darwin {
     122platform darwin {
     123    set cmake._archflag_vars {cc_archflags cxx_archflags ld_archflags objc_archflags objcxx_archflags universal_cflags universal_cxxflags universal_ldflags universal_objcflags universal_objcxxflags}
     124
     125    pre-configure {
     126        # cmake will add the correct -arch flag(s) based on the value of CMAKE_OSX_ARCHITECTURES.
    122127        if {[variant_exists universal] && [variant_isset universal]} {
    123128            if {[info exists universal_archs_supported]} {
     129                merger_arch_compiler no
     130                merger_arch_flag no
    124131                global merger_configure_args
    125132                foreach arch ${universal_archs_to_use} {
     
    135142        }
    136143
     144        # Setting our own -arch flags is unnecessary (in the case of a non-universal build) or even
     145        # harmful (in the case of a universal build, because it causes the compiler identification to
     146        # fail; see http://public.kitware.com/pipermail/cmake-developers/2015-September/026586.html).
     147        # Save all archflag-containing variables before changing any of them, because some of them
     148        # declare their default value based on the value of another.
     149        foreach archflag_var ${cmake._archflag_vars} {
     150            global cmake._saved_${archflag_var}
     151            set cmake._saved_${archflag_var} [option configure.${archflag_var}]
     152        }
     153        foreach archflag_var ${cmake._archflag_vars} {
     154            configure.${archflag_var}
     155        }
     156
    137157        configure.args-append -DCMAKE_OSX_DEPLOYMENT_TARGET="${macosx_deployment_target}"
    138158
     
    141161        } else {
    142162            configure.args-append -DCMAKE_OSX_SYSROOT="/"
     163        }
     164    }
     165
     166    post-configure {
     167        # Although cmake wants us not to set -arch flags ourselves when we run cmake,
     168        # ports might have need to access these variables at other times.
     169        foreach archflag_var ${cmake._archflag_vars} {
     170            global cmake._saved_${archflag_var}
     171            configure.${archflag_var} [set cmake._saved_${archflag_var}]
    143172        }
    144173    }
Note: See TracChangeset for help on using the changeset viewer.