On Sep 29, 2015, at 1:54 AM, Nils Gladitz wrote:

> Is it possible that beyond setting CMAKE_OSX_ARCHITECTURES the project also 
> tries to manually add -arch flags to CFLAGS/CXXFLAGS?
> 
> The test binary produced for compiler identification with just 
> CMAKE_OSX_ARCHITECTURES set is not a fat binary for me and identification is 
> successful (CMake 3.3.2).
> 
> Manually adding "-arch x86_64 -arch i386" to the compiler flags breaks this 
> since now the test binary itself is also fat.

You are correct: in addition to giving cmake the 
-DCMAKE_OSX_ARCHITECTURES="x86_64;i386" argument, MacPorts includes "-arch 
x86_64 -arch i386" in the CFLAGS, CXXFLAGS, and LDFLAGS environment variables. 
I am not certain, but I think the only reason why we are doing this for 
cmake-using ports is that we do this for all ports, and no code was ever added 
to override this for cmake-using ports. Perhaps this didn't cause problems 
before, or we never noticed it caused problems before. I will work adding code 
to MacPorts to remove these flags for cmake-using ports. Thanks for the 
suggestion.

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to