MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0015493 | CMake | CMake | public | 2015-04-03 10:58 | 2015-11-02 09:13 |
Reporter | Aleksey Konovalov | ||||
Assigned To | Brad King | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | OS | OS Version | |||
Product Version | |||||
Target Version | CMake 3.3 | Fixed in Version | CMake 3.3 | ||
Summary | 0015493: incorrect file parsing, if it has a BOM-header | ||||
Description | The #include directive in the first line of the c/c++ source file is ignored if the file contains a BOM-header. In this case, the file depend.make is not included this header file and its dependencies. My patch fixes this problem: From 281e67e98961c1b2dcf0979dc3a38d5a1fa0b42a Mon Sep 17 00:00:00 2001 From: Aleksey Konovalov <konovalov.aleks@gmail.com> Date: Fri, 3 Apr 2015 17:38:11 +0300 Subject: [PATCH] Skipping BOM-header while parsing a C-source --- Source/cmDependsC.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 63d8fa6..60937b6 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -242,6 +242,9 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources, cmsys::ifstream fin(fullName.c_str()); if(fin) { + // Skip BOM-header if it exists + cmsys::FStream::ReadBOM(fin); + // Add this file as a dependency. dependencies.insert(fullName); -- 1.8.1.4 | ||||
Steps To Reproduce | Attached file cmake_test.zip contains test-project. File test.cpp contains BOM-header in first line. CMake ignores this #include directive and does not add test.h to depend.make. Because of this, compilation does not occur when you modify test.h | ||||
Additional Information | current depend.make content: --------------------------------------------------------------- # CMAKE generated file: DO NOT EDIT! # Generated by "Unix Makefiles" Generator, CMake Version 2.8 CMakeFiles/test.dir/test.cpp.o: ../test.cpp --------------------------------------------------------------- expected depend.make content: --------------------------------------------------------------- # CMAKE generated file: DO NOT EDIT! # Generated by "Unix Makefiles" Generator, CMake Version 3.2 CMakeFiles/test.dir/test.cpp.o: ../test.cpp CMakeFiles/test.dir/test.cpp.o: ../test.h --------------------------------------------------------------- | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | cmake_test.zip (376) 2015-04-03 10:58 https://public.kitware.com/Bug/file/5419/cmake_test.zip | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2015-04-03 10:58 | Aleksey Konovalov | New Issue | |||
2015-04-03 10:58 | Aleksey Konovalov | File Added: cmake_test.zip | |||
2015-04-03 13:24 | Brad King | Note Added: 0038396 | |||
2015-04-03 13:25 | Brad King | Assigned To | => Brad King | ||
2015-04-03 13:25 | Brad King | Status | new => resolved | ||
2015-04-03 13:25 | Brad King | Resolution | open => fixed | ||
2015-04-03 13:25 | Brad King | Fixed in Version | => CMake 3.3 | ||
2015-04-03 13:25 | Brad King | Target Version | => CMake 3.3 | ||
2015-11-02 09:13 | Robert Maynard | Note Added: 0039757 | |||
2015-11-02 09:13 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|