View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015641CMakeCMakepublic2015-07-08 09:272016-01-04 11:51
ReporterNikolay Zapolnov 
Assigned ToBrad King 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformAppleOSOSXOS Version10.10.4
Product VersionCMake 3.2.3 
Target VersionCMake 3.3Fixed in VersionCMake 3.3 
Summary0015641: In CMake 3.3.0-rc3 macro CHECK_CXX_COMPILER_FLAG is broken on OSX for some flags
DescriptionIn CMake 3.2.3 the CHECK_CXX_COMPILER_FLAG macro launches compiler and then linker.
But tested flag is passed *only* to the compiler and test passes.

But in CMake 3.3.0-rc3 argument is passed to *both* the compiler and the linker. This causes an error for some flags, for example for '-x objective-c++'. Passing this flag to the linker makes it recognize .o files as objective-c++ sources and fail.
Steps To ReproduceUse the following CMakeLists.txt

INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-x objective-c++" HAVE_OBJC)

This will work correctly in CMake 3.2.3 but in CMake 3.3.0-rc3 HAVE_OBJC will be always false.
Additional InformationPart of CMakeOutput.log for good case and part of CMakeError.log for broken case are attached to the ticket.
TagsNo tags attached.
Attached Fileslog file icon good-cmake322.log [^] (1,364 bytes) 2015-07-08 09:27
log file icon broken-cmake330rc3.log [^] (1,201,657 bytes) 2015-07-08 09:27

 Relationships

  Notes
(0039086)
Brad King (manager)
2015-07-08 10:01

Thanks for testing the release candidate!

This problem was introduced by the patch posted here:

 [PATCH] fix use of CMAKE_REQUIRED_DEFINITIONS
 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/12520 [^]

and committed here:

 Check*CompilerFlag: Refactor method used to pass flags
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d5067ae [^]

We'll have to revert it and add a test case for compiler-only flags.
(0039087)
Brad King (manager)
2015-07-08 10:07

Fixed and test case added:

 Check*CompilerFlag: Revert to previous method used to pass flags
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a639689c [^]

I've queued this for merge to the 'release' branch for 3.3.
(0040089)
Robert Maynard (manager)
2016-01-04 11:51

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

 Issue History
Date Modified Username Field Change
2015-07-08 09:27 Nikolay Zapolnov New Issue
2015-07-08 09:27 Nikolay Zapolnov File Added: good-cmake322.log
2015-07-08 09:27 Nikolay Zapolnov File Added: broken-cmake330rc3.log
2015-07-08 10:01 Brad King Note Added: 0039086
2015-07-08 10:01 Brad King Assigned To => Brad King
2015-07-08 10:01 Brad King Status new => assigned
2015-07-08 10:01 Brad King Target Version => CMake 3.3
2015-07-08 10:07 Brad King Note Added: 0039087
2015-07-08 10:07 Brad King Status assigned => resolved
2015-07-08 10:07 Brad King Resolution open => fixed
2015-07-08 10:07 Brad King Fixed in Version => CMake 3.3
2016-01-04 11:51 Robert Maynard Note Added: 0040089
2016-01-04 11:51 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team