MantisBT - CMake
View Issue Details
0015427CMakeCMakepublic2015-02-28 12:552016-06-10 14:31
Clinton Stimpson 
Kitware Robot 
normalminorhave not tried
closedmoved 
OS X10.9
CMake 3.2 
 
0015427: Xcode generation omits CXX flags for linking
If I set CXXFLAGS (env var) or CMAKE_CXX_FLAGS, the resulting Xcode project does not contain those flags when linking C++ binaries, but a resulting Makefile does.

This can result in link errors when building with Xcode which one does not see when building with Makefiles.
Using the attached project, build using Makefiles and it works fine.
Build with Xcode and one gets link errors about unresolved symbols from the standard c++ library.

Notice how the -stdlib=libstdc++ flag is missing from the link command under Xcode.
No tags attached.
tar test-stdlib.tar (3,584) 2015-02-28 12:55
https://public.kitware.com/Bug/file/5395/*
Issue History
2015-02-28 12:55Clinton StimpsonNew Issue
2015-02-28 12:55Clinton StimpsonFile Added: test-stdlib.tar
2015-03-02 12:39Sean McBrideNote Added: 0038136
2015-03-02 14:11Brad KingNote Added: 0038137
2016-06-10 14:29Kitware RobotNote Added: 0042723
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0038136)
Sean McBride   
2015-03-02 12:39   
The inconsistency is bad for sure, but there are complier flags that the linker does not support. If compiler flags always get passed to the linker, that could be a problem...
(0038137)
Brad King   
2015-03-02 14:11   
Re 0015427:0038136: We're talking about passing CMAKE_<LANG>_FLAGS to the <LANG> compiler front-end when using it to drive the linker. The front-end knows which options affect how it invokes the linker. This is already done for other generators and is simply missing for Xcode, according to this report.
(0042723)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.