[MacPorts] #69317: supported_archs noarch prevents CMake from setting correct flags

MacPorts noreply at macports.org
Sun Feb 11 13:43:11 UTC 2024


#69317: supported_archs noarch prevents CMake from setting correct flags
--------------------------+--------------------------------
 Reporter:  barracuda156  |      Owner:  (none)
     Type:  defect        |     Status:  new
 Priority:  Normal        |  Milestone:
Component:  ports         |    Version:  2.9.1
 Keywords:                |       Port:  cmake, cmake-devel
--------------------------+--------------------------------
 A port may not install arch-specific files, but it may build such
 (typically tests). Building requires correct arch flags to be passed.
 However it appears that `supported_archs noarch` (which is assigned on a
 basis of installed objects) forces `-DCMAKE_OSX_ARCHITECTURES=""`, and
 arch flags vanish. This is wrong. The only reason why it is not obvious is
 that buildbots build for a native arch, which works. There are multiple
 scenarios where arch flags are required though.

 As an example, this is what I get with `CLI11`:
 {{{
 --->  Configuring CLI11
 Executing:  cd
 "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/build"
 && /opt/local/bin/cmake -G "CodeBlocks - Unix Makefiles"
 -DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/opt/local"
 -DCMAKE_INSTALL_NAME_DIR="/opt/local/lib"
 -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_C_COMPILER="$CC"
 -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC"
 -DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW
 -DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON
 -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST
 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=/usr/bin/make
 -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules"
 -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules"
 -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON
 -DCMAKE_INSTALL_RPATH="/opt/local/lib" -Wno-dev -DCLI11_BUILD_TESTS=ON
 -DCLI11_BUILD_EXAMPLES=OFF -DCMAKE_OSX_ARCHITECTURES=""
 -DCMAKE_OSX_DEPLOYMENT_TARGET="10.6" -DCMAKE_OSX_SYSROOT="/"
 /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_CLI11/CLI11/work/CLI11-2.4.1
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/69317>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list