[cmake-developers] [CMake 0013472]: Assembly files do not get recognized correctly
Mantis Bug Tracker
mantis at public.kitware.com
Wed Aug 15 09:13:00 EDT 2012
The following issue has been SUBMITTED.
======================================================================
http://public.kitware.com/Bug/view.php?id=13472
======================================================================
Reported By: Tobias Pape
Assigned To:
======================================================================
Project: CMake
Issue ID: 13472
Category: CMake
Reproducibility: always
Severity: major
Priority: normal
Status: new
======================================================================
Date Submitted: 2012-08-15 09:12 EDT
Last Modified: 2012-08-15 09:12 EDT
======================================================================
Summary: Assembly files do not get recognized correctly
Description:
On OS X using Xcode generator and enabled ASM language,
assembler files, such as *.s, *.S do not get compiled correctly.
A PRE_BUILD add_custom_command build step helps but is very cumbersome.
Here is a valid fix for cmake:
in cmGlobalXCodeGenerator.cxx there should be:
std::string
GetSourcecodeValueFromFileExtension(const std::string& _ext,
const std::string& lang)
{
std::string ext = cmSystemTools::LowerCase(_ext);
std::string sourcecode = "sourcecode";
if(ext == "o")
{
sourcecode = "compiled.mach-o.objfile";
}
else if(ext == "xib")
{
sourcecode = "file.xib";
}
else if(ext == "storyboard")
{
sourcecode = "file.storyboard";
}
else if(ext == "mm")
{
sourcecode += ".cpp.objcpp";
}
else if(ext == "m")
{
sourcecode += ".c.objc";
}
else if(ext == "xib")
{
sourcecode += ".file.xib";
}
else if(ext == "plist")
{
sourcecode += ".text.plist";
}
else if(ext == "h")
{
sourcecode += ".c.h";
}
else if(ext == "hxx" || ext == "hpp" || ext == "txx"
|| ext == "pch" || ext == "hh")
{
sourcecode += ".cpp.h";
}
else if(ext == "png" || ext == "gif" || ext == "jpg")
{
sourcecode = "image";
}
else if(ext == "txt")
{
sourcecode += ".text";
}
else if(lang == "CXX")
{
sourcecode += ".cpp.cpp";
}
else if(lang == "C")
{
sourcecode += ".c.c";
}
else if(lang == "ASM" || ext == "S" || ext == "s")
{
sourcecode += ".asm";
}
else if(lang == "Fortran")
{
sourcecode += ".fortran.f90";
}
//else
// {
// // Already specialized above or we leave sourcecode == "sourcecode"
// // which is probably the most correct choice. Extensionless headers,
// // for example... Or file types unknown to Xcode that do not map to a
// // valid lastKnownFileType value.
// }
return sourcecode;
}
Additional Information:
A different Fix would be to allow overriding the Source-code type via CMake code
akin to the XCODE_ATTRIBUTE_* properties that can be set on targets.
I would propose XCODE_ATTRIBUTE_FILE_TYPE.
Note that compiling assembly using the Makefile generator just works fine.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2012-08-15 09:12 Tobias Pape New Issue
======================================================================
More information about the cmake-developers
mailing list