Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: ensure directory holding pch.pch file is created #3141

Closed
wants to merge 1 commit into from

Conversation

pmolodo
Copy link
Contributor

@pmolodo pmolodo commented Jun 25, 2024

Description of Change(s)

When specifying a precompiled header output via cl /Fp${folder}/${filename}, cl won't automatically create ${folder}. Ensure we do this, or cl will error.

This may be an issue only with VS2022 or Windows 11, as I've never encountered this before, and I those are the main new variables. (Note that I was also build with Ninja, though I've been doing that for a while, and haven't changed the version in a while.)

Versions

  • USD: latest dev (5332d62)
  • CMake: 3.27.9
  • OS: Windows 11, 23H2, Build 22631.3737
  • Visual Studio: 2022 LTSC 17.8.11+34931.61
  • .NET Framework: 4.8.09032
  • Visual C++: 2022 00476-80000-00000-AA016
  • Ninja: 1.10.2

Fixes Issue(s)

  • Without this, I got the following error when compiling with precompiled headers enabled:
[479/4528] Building CXX object pxr\base\arch\CMakeFiles\arch.dir\pch.cpp.obj
FAILED: pxr/base/arch/CMakeFiles/arch.dir/pch.cpp.obj
C:\OpenUSD\_build\host-deps\msvc\VC\Tools\MSVC\bin\HostX64\x64\cl.exe  /nologo /TP -DARCH_EXPORTS=1 -DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB -DBOOST_PYTHON_NO_PY_SIGNATURES -DGLX_GLXEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES -DMFB_ALT_PACKAGE_NAME=arch -DMFB_PACKAGE_MODULE=Arch -DMFB_PACKAGE_NAME=arch -DNOMINMAX -DOPENEXR_DLL -DPXR_BUILD_LOCATION=usd -DPXR_GL_SUPPORT_ENABLED -DPXR_MATERIALX_SUPPORT_ENABLED -DPXR_OIIO_PLUGIN_ENABLED -DPXR_PLUGIN_BUILD_LOCATION=../plugin/usd -DWIN32_LEAN_AND_MEAN -DYY_NO_UNISTD_H -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -Darch_EXPORTS -IC:\OpenUSD\_build\USD\include /EHsc /Zc:rvalueCast /Zc:strictStrings /Zc:inline- /W3 /bigobj /Zi /MP /Gm- /wd4003 /wd4244 /wd4305 /wd4267 /wd4506 /wd4091 /wd4273 /wd4180 /wd4334 -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 /MD /O2 /Ob2 /DNDEBUG -std:c++17 /Yc"pxr/base/arch/pch.h" /FI"pxr/base/arch/pch.h" /Fp"C:/OpenUSD/_build/USD/include/pxr/base/arch/Release/pch.pch" /showIncludes /Fopxr\base\arch\CMakeFiles\arch.dir\pch.cpp.obj /Fdpxr\base\arch\CMakeFiles\arch.dir\ /FS -c C:\OpenUSD\_build\USD\pxr\base\arch\pch.cpp
c1xx: fatal error C1083: Cannot open compiler intermediate file: 'C:/OpenUSD/_build/USD/include/pxr/base/arch/Release/pch.pch': No such file or directory
  • I have verified that all unit tests pass with the proposed changes
  • I have submitted a signed Contributor License Agreement

When specifying a precompiled header output via `cl /Fp<folder>/<filename>`,
cl won't automatically create <folder>.  Ensure we do this, or it will
error.
@jesschimein
Copy link
Collaborator

Filed as internal issue #USD-9803

@jesschimein
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@DDoS
Copy link
Contributor

DDoS commented Jul 30, 2024

For anyone else having this issue: add --cmake-build-args="-DPXR_ENABLE_PRECOMPILED_HEADERS=OFF" to your build command line to workaround it.

@pmolodo
Copy link
Contributor Author

pmolodo commented Aug 4, 2024

For anyone else having this issue: add --cmake-build-args="-DPXR_ENABLE_PRECOMPILED_HEADERS=OFF" to your build command line to workaround it.

Heh, I was wondering if I was the only one hitting this. Would be nice to get it merged - it's a small / easy fix (as opposed to some other PRs that somebody made recently :suspect: ...)

@mistafunk
Copy link

Oh, I just fixed the same as well in #3204 ... didn't see this PR here.

@pmolodo
Copy link
Contributor Author

pmolodo commented Aug 5, 2024

Closing in favor of #3204

@pmolodo pmolodo closed this Aug 5, 2024
@pmolodo
Copy link
Contributor Author

pmolodo commented Aug 5, 2024

Oh - and @mistafunk - hope you didn't think this comment was referring to you:

Would be nice to get it merged - it's a small / easy fix (as opposed to some other PRs that somebody made recently :suspect: ...)

I also didn't realize there was another PR for the same stuff. The comment above was just trying to poke fun at myself, since I just made a big drop of a large chain of PRs...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants