-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Precompiled headers are used by default on Windows because they reduce compile time significantly. They are not used by default elsewhere because they significantly slow down compile time. The PXR_ENABLE_PRECOMPILED_HEADERS option controls whether precompiled headers are used or not. If enabled, precompiled headers are used for shared libraries, static libraries, and plugins. They can be disabled by using the DISABLE_PRECOMPILED_HEADERS option to the call to pxr_shared_library, etc. The default name for the header to be precompiled is pch.h but this can be overridden per library/plugin with the PRECOMPILED_HEADER_NAME argument to pxr_shared_library, etc. or globally with PXR_PRECOMPILED_HEADER_NAME, with the former having precedence over the latter. The comments below assume the name is pch.h. When a precompiled header is enabled each C++ compile implicitly includes the pch.h header before everything else. So other than creating the pch.h file there should be no other changes to the code needed to use precompiled headers. However, if there is no pch.h to precompile then DISABLE_PRECOMPILED_HEADERS must be added so cmake doesn't look for it. There's a problem using 'def(str(self))' when wrapping a class to Python using boost python. For some reason the appropriate overload isn't deduced (or something) and the code fails to compile when using precompiled headers. For now we simply replace that code with something more explicit but equivalent. There was also a problem in a few places where a macro was defined (to affect later macros) but there aren't any guards around it to prevent redefinition (as there will be when using precompiled headers). The guards were added. Some other tweaks were made as well to simplify the job of a script (not included in this checkin) to automatically generate the pch.h files from the code. (Internal change: 1733379)
- Loading branch information
Showing
62 changed files
with
6,456 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.