T O P I C R E V I E W |
kornman00 |
Posted - Jan 17 2012 : 4:00:27 PM In my VS2010 C++ projects, I define some common properties in an external .props file which my vcxprojs then include.
Included in the common properties .props file are my PCH definitions, eg:
...
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>Precompile.hpp</PrecompiledHeaderFile>
...
In one project, I'm building with the [url=clang.llvm.org]Clang[/url]/LLVM libraries, and the needed headers from said libraries are all included in my Precompile.hpp header.
VAX isn't processing this PCH.
When I open the project, all of the Clang symbols fail to get colorized by VAX (this takes place every time). If, however, I manually view Precompile.hpp, it goes out and parses the various Clang related headers and everything gets highlighted correctly (again, I have to do this every time I open the project).
So it leads me to believe VAX can't handle PCH configs when they're not directly defined in the vcxproj itself.
FYI, I "import" my .props file right after "PropertySheets" and right before "UserMacros" in my vcxproj. I'm running build 10.6.1862.0 in VS2010. |
16 L A T E S T R E P L I E S (Newest First) |
accord |
Posted - Jan 22 2012 : 5:14:15 PM Replied by email. For the followers of the topic: the problem seems to be solved. will see if it stays this way. |
kornman00 |
Posted - Jan 21 2012 : 7:24:51 PM Submitted |
accord |
Posted - Jan 21 2012 : 7:03:35 PM Thank you for the settings. I glanced them and everything seems to be correct.
Can you do the following, hopefully last experiment? 1. When your project is open, please close "Precompile.hpp" 2. Please press VA Options -> Performance -> Rebuild 3. Close your project if it loads automatically when VS starts 4. Restart Visual Studio 5. Tick the following option: VA Options -> Performance -> Enable logging 6. Load your project 7. Wait while Visual Assist finishes parsing your project (you can see it in the status bar) 8. Exit VS 9. Please send in the log files. You can learn more about where you will find them: http://docs.wholetomato.com?W305
The logs will contain your recognized include directories, the files VA parses, and hopefully the problems the parser faces. |
kornman00 |
Posted - Jan 20 2012 : 7:47:18 PM That, and all of the other paths within $(LLVMIncludes) (Clang has dependencies to LLVM)
I'll submit my settings after this post |
accord |
Posted - Jan 20 2012 : 7:26:07 PM So are the files included by Precompile.hpp located in the following directory?
$(LLVMSourceDir)\\tools\\clang\\include |
accord |
Posted - Jan 20 2012 : 7:20:13 PM Thank you for the file, now I see the full logic.
Can you please also send you Visual Assist settings?
VA Options -> Performance -> Export |
kornman00 |
Posted - Jan 19 2012 : 8:54:11 PM I have one symbol defined, "typedef const char* cstring;", which VAX recognizes without me opening Precompile.hpp before hand.
alt+shift+o correctly shows Precompile.hpp/cpp.
This is looking more like VA can't open the Clang includes, since it's aware of "cstring" after the project is loaded.
I'll also send you my SharedBuild.targets file in another Contact email as I think I left it out. This is where the paths to the LLVM/Clang source are defined. The paths aren't straight forward MSBuild macros as some root source directories are determined based on the machine name (via Condition attributes). You'll understand once you see the file. |
accord |
Posted - Jan 19 2012 : 6:20:03 PM Can you please try a simple test, so I know what to look for / how to proceed. Do you have any symbols defined directly in Precompile.hpp itself, or does it only include other files? Can you please declare a symbol directly in that file if it doesn't currently the case? My question: are the symbols directly declared in Precompile.hpp colored after opening the project, if you don't open this file directly? I'm wondering whether the file is not parsed, or the file is parsed, but the VA cannot open the includes. (the Clang files)
If you press alt+shift+o, does "precompile.hpp" listed in "Open file in solution" dialog? (you can filter the listbox) |
kornman00 |
Posted - Jan 18 2012 : 9:07:24 PM Yessir. Would you like me to send in a copy of my settings to help as reference?
However, I'm not currently using your suggested work around of turning on "VA Options -> File handling -> ...if a solution is not empty" as it's global and I don't want it parsing non-project source that happens to be in any sln I open (eg, there are input .h/cpp files used for testing custom Clang code that aren't actual source files for the project). |
accord |
Posted - Jan 18 2012 : 8:21:24 PM One more idea: is the following option is ticked for you?
VA Options -> Performance -> Parse all files when opening a project |
accord |
Posted - Jan 18 2012 : 8:16:03 PM I looked into you project and now I understand it. The precompiled header is included in the project itself and VA sees it. The props is used to add additional properties, like additional include directory. In fact, this is the only property that can affect parsing. The strange part is that why VA is able to parse the file (Precompile.hpp) when you open it, and why it can't when you don't. VA normally parses all files in the project, when you open it. (You said: "If, however, I manually view Precompile.hpp, it goes out and parses the various Clang related headers") Will dig deeper. |
accord |
Posted - Jan 18 2012 : 7:25:17 PM No need to resubmit it. I got the files, thank you. Will investigate. |
kornman00 |
Posted - Jan 18 2012 : 5:31:12 PM No problemo
I submitted the files via the contact page shortly after my last post (subject "TOPIC_ID=10543"). Let me know if I need to resubmit. |
feline |
Posted - Jan 18 2012 : 4:57:13 PM Please submit the files via the form:
http://www.wholetomato.com/support/contact.asp
including this thread ID or URL in the description, so we can match it up. A good catch on that post, thank you for that, I will update it next. |
kornman00 |
Posted - Jan 18 2012 : 1:32:38 PM VS2010 C++ doesn't use .vsprops (style sheets) anymore, it uses the (more MSBuild-based) .props.
Just like the MSDN .props example, I define a ItemDefinitionGroup, which has a ClCompile and Link which my projects inherit form.
<ItemDefinitionGroup>
<ClCompile>
...
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>Precompile.hpp</PrecompiledHeaderFile>
...
</ClCompile>
<Link>
...
</Link>
</ItemDefinitionGroup>
Note that every project that Imports this .props file also has it's own local, and included in the .vcxproj's ItemGroup, Precompile.hpp (ie, it resides in the same dir as the project file).
I'll email the props and vcxproj to the support email (with this topic id) to help paint the picture.
EDIT: appears you no longer accept direct emails to that (fair enough). Might want to update this post. |
accord |
Posted - Jan 18 2012 : 09:17:22 AM I don't have experience using vsprops but as far as I understand, vsprops are used to set or overwrite settings. From MSDN: "It enables you to specify switches for build tools such as the compiler or linker and create user-defined macros."
Visual Assist basically parses files that are included in your project. So the question arises: does Visual Studio handles these "PrecompiledHeaderFile" entries as files in the project? My files are usually represented by tokens like: <ClInclude Include="demo.h" />
So my question is: can you please check whether the files referred via PrecompiledHeaderFile are listed in the solution explorer? (It's called "Precompile.hpp" in your example). Visual Assist should parse files that are in the solution explorer. If it isn't there, VA don't know about the file. Irrespective of the answer to the previous question, there is a setting which can help you in this situation:
VA Options -> File handling -> ...if a solution is not empty
If you this this checkbox, VA will parse all other files in the same directory when you open a file. The tooltip has more info. So basically, if your precompiled header is in a directory among other files, it will help. |