View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015264CMakeCMakepublic2014-11-25 04:222015-04-06 09:07
ReporterEvgeniy Stepanov 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionduplicate 
Platformx86_64OSLinuxOS Version
Product VersionCMake 3.0.2 
Target VersionFixed in Version 
Summary0015264: check_cxx_compiler_flag fails to use linker flags
Descriptioncheck_cxx_compiler_flag test compilation AND linking of a test source file, but it fails to use linker flags when doing so.

In certain configurations, custom compiler flags used by the project require custom linker flags. For example, if I've got libc++ in a non-standard location, I would use CMAKE_CXX_FLAGS=-stdlib=libc++ CMAKE_EXE_LINKER_FLAGS=-L/path/to/libc++ CMAKE_MODULE_LINKER_FLAGS=-L/path/to/libc++ CMAKE_SHARED_LINKER_FLAGS=-L/path/to/libc++.

In this situation, check_cxx_compiler_flag uses compiler flags, but not linker flags, which fails linking if there is no system-wide installation of libc++.

See also: http://llvm.org/bugs/show_bug.cgi?id=19071 [^]

Note that there is a similar problem with the compiler test ("Check for working CXX compiler"). It uses CMAKE_CXX_FLAGS and env['LDFLAGS']. It does not use any of CMAKE_*_LINKER_FLAGS or env['CXXFLAGS']. It does not make any sense to me. Let me know if I should file it as a separate issue.
TagsNo tags attached.
Attached Files

 Relationships
duplicate of 0014066closedBrad King Provided CMAKE_*_LINKER_FLAGS ignored during configuration step 

  Notes
(0037280)
Brad King (manager)
2014-11-25 09:51

Resolving as duplicate of 0014066. See 0014066:0037279.
(0038447)
Robert Maynard (manager)
2015-04-06 09:07

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2014-11-25 04:22 Evgeniy Stepanov New Issue
2014-11-25 09:46 Brad King Relationship added duplicate of 0014066
2014-11-25 09:51 Brad King Note Added: 0037280
2014-11-25 09:51 Brad King Status new => resolved
2014-11-25 09:51 Brad King Resolution open => duplicate
2015-04-06 09:07 Robert Maynard Note Added: 0038447
2015-04-06 09:07 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team