mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-08-17 17:31:44 +08:00
2.4 KiB
2.4 KiB
Solution and Project File Structure
- A solution file (
*.slnor*.slnx) contains multiple project files. - Typical C++ project files are XML files in
*.vcxprojor*.vcxitemsnaming. - The XML file
*.vcxitems.filtersor*.vcxproj.filtersorganizes source files in solution explorer folders (virtual folders) that can be different from the physical file system, creating a human-friendly view. - The XML file
*.vcxproj.usercontains some temporary local configuration for a project. This file is not tracked by git, but it contains arguments for running the project. - When adding a source file to a specific solution explorer folder:
- It must also be added to one or multiple project files.
- Find the
*.vcxitems.filtersor*.vcxproj.filtersfile with the same name. - Each file must be attached to a solution explorer folder, described in this XPath:
/Project/ItemGroup/ClCompile@Include="PhysicalFile"/Filter. - Inside the
Filtertag there is the solution explorer folder. - Edit that
*.vcxitems.filtersor*.vcxproj.filtersfile to include the source file.
Renaming and Removing Source Files
- All affected
*.vcxitems,*.vcxproj,*.vcxitems.filtersand*.vcxproj.filtersmust be updated.
Working on Linux
makefile for each project is generated from MSBuild project files during the build.
When the file list needs to be modified, update MSBuild project files directly.
After building, vmake file generates both vmake.txt and makefile.
If you doubt whether the file is built or not, check out vmake.txt, which simply lists all used cpp files in makefile.
Linux specific C++ source files also need to be added to MSBuild project files, and they are excluded from the build.
In vmake, Windows specific C++ source files need to be excluded.
When the Main.cpp from MSBuild projects or similar files does not work on Linux, you are recommended to create one for Linux.
In vmake, these variables are available for configuration, most of them are optional:
CPP_VCXPROJS: Use MSBuild project files, they are typically*.vcxitemsor*.vcxproj.CPP_REMOVES: Files to exclude, from the file list generated fromCPP_VCXPROJS.CPP_ADDS: Files to add.CPP_COMPILE_OPTIONS: Extra compiler options forclang++org++.FOLDERS: Folders that contain generated files. These folders will be completely removed during a full build.CPP_TARGET: The compiled binary.