View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007340CMakeCMakepublic2008-07-15 13:182008-07-16 11:06
ReporterYuri 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0007340: Can't call TRY_COMPILE before PROJECT directive.
DescriptionTo tune compiler and linker options I want to use CMAKE_USER_MAKE_RULES_OVERRIDE variable (in addition to ones provided by CMake). To determine whether compiler supports particular flags I use TRY_COMPILE command.
This works in cmake-2.4.8 but fails in cmake 2.6.0. See examples attached.
Additional InformationI suppose this is caused by splitting EnableLanguage logic in CMake 2.6.

cmGlobalGenerator::EnableLanguage function:

In 2.4 after CMake(LANG)Compiler.cmake processed language becomes enabled and LanguageToOutputExtension map filled before processing CMake(LANG)Information.cmake where custom rules are called from.

In 2.6 after first stage, SetLanguageEnabledFlag called but LanguageToOutputExtension stays clean while CMake(LANG)Information.cmake is being processed, so nested call to ReadListFile() fails to get language by extension.
TagsNo tags attached.
Attached Fileszip file icon CompilerTest.zip [^] (507 bytes) 2008-07-15 13:18

 Relationships

  Notes
(0012722)
Brad King (manager)
2008-07-16 11:05

The extension-to-language map must be filled before loading CMake<LANG>Information.cmake since that file includes the user-override files. It must be filled after loading that file since it includes the compiler- and platform-specific settings. The solution is to just fill it both before and after.

Fixed:

/cvsroot/CMake/CMake/Source/cmGlobalGenerator.cxx,v <-- Source/cmGlobalGenerator.cxx
new revision: 1.237; previous revision: 1.236
/cvsroot/CMake/CMake/Source/cmGlobalGenerator.h,v <-- Source/cmGlobalGenerator.h
new revision: 1.113; previous revision: 1.112

 Issue History
Date Modified Username Field Change
2008-07-15 13:18 Yuri New Issue
2008-07-15 13:18 Yuri File Added: CompilerTest.zip
2008-07-15 13:36 Bill Hoffman Status new => assigned
2008-07-15 13:36 Bill Hoffman Assigned To => Alex Neundorf
2008-07-16 11:03 Brad King Assigned To Alex Neundorf => Brad King
2008-07-16 11:05 Brad King Note Added: 0012722
2008-07-16 11:06 Brad King Status assigned => closed
2008-07-16 11:06 Brad King Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team