Fix various build issues and warnings on Linux #63

Merged
Brecht Van Lommel merged 2 commits from brecht/blender:hydra-build-linux into hydra-render 2023-07-13 20:26:51 +02:00
Collaborator
  • Fix build when WITH_USD and WITH_MATERIALX are disabled
  • Link issue with mixed Clang and GCC libs
  • Unused arguments
  • Different integer printf types on Windows and Linux
* Fix build when WITH_USD and WITH_MATERIALX are disabled * Link issue with mixed Clang and GCC libs * Unused arguments * Different integer printf types on Windows and Linux
Brecht Van Lommel added 1 commit 2023-07-10 20:14:33 +02:00
Bogdan Nagirniak requested review from Brian Savery (AMD) 2023-07-11 17:37:47 +02:00
Bogdan Nagirniak requested review from Georgiy Markelov 2023-07-11 17:37:48 +02:00
Bogdan Nagirniak requested review from Vasyl Pidhirskyi 2023-07-11 17:37:48 +02:00
Brian Savery (AMD) approved these changes 2023-07-11 23:49:41 +02:00
Bogdan Nagirniak requested changes 2023-07-12 14:48:06 +02:00
Bogdan Nagirniak left a comment
Owner

Compile error in Windows

Compile error in Windows
@ -43,9 +55,21 @@ set(INC_SYS
${BOOST_INCLUDE_DIR}
${TBB_INCLUDE_DIR}
${GFLAGS_INCLUDE_DIRS}
${LIBDIR}/MaterialX/include

This produces compile error
D:\amd\blender-git\lib\win64_vc15\usd\include\pxr/usd/usdMtlx/reader.h(31,10): fatal error C1083: Cannot open include file: 'MaterialXCore/Document.h': No such file or directory (compiling source file D:\amd\blender-git\blender\source\b lender\render\hydra\scene_delegate\mtlx_hydra_adapter.cc) [D:\amd\blender-git\buildnew\source\blender\render\hydra\bf_render_hydra.vcxproj]

This produces compile error `D:\amd\blender-git\lib\win64_vc15\usd\include\pxr/usd/usdMtlx/reader.h(31,10): fatal error C1083: Cannot open include file: 'MaterialXCore/Document.h': No such file or directory (compiling source file D:\amd\blender-git\blender\source\b lender\render\hydra\scene_delegate\mtlx_hydra_adapter.cc) [D:\amd\blender-git\buildnew\source\blender\render\hydra\bf_render_hydra.vcxproj]`
Author
Collaborator

The thing is that we should not be using LIBDIR here, since that assumes precompiled libraries which is not always the case.

So instead I added MaterialXCore to LIB, which should automatically add the associated includes when used with find_package(MaterialX). This is the system that we are trying to move towards. However Windows doesn't seem to do this.

Can you get find_package(MaterialX) working in platform_win32.cmake?

If not, I guess you could do something manual there:

add_library(MaterialXCore SHARED IMPORTED)
set_target_properties(MaterialXCore PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${LIBDIR}/MaterialX/include"
)
The thing is that we should not be using `LIBDIR` here, since that assumes precompiled libraries which is not always the case. So instead I added `MaterialXCore` to `LIB`, which should automatically add the associated includes when used with `find_package(MaterialX)`. This is the system that we are trying to move towards. However Windows doesn't seem to do this. Can you get `find_package(MaterialX)` working in `platform_win32.cmake`? If not, I guess you could do something manual there: ``` add_library(MaterialXCore SHARED IMPORTED) set_target_properties(MaterialXCore PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBDIR}/MaterialX/include" ) ```
Brecht Van Lommel added 1 commit 2023-07-13 15:30:30 +02:00
Bogdan Nagirniak approved these changes 2023-07-13 20:25:05 +02:00
Bogdan Nagirniak left a comment
Owner

After updates, build is working now.

After updates, build is working now.
Brecht Van Lommel merged commit 9e7dd8bbc2 into hydra-render 2023-07-13 20:26:51 +02:00
Sign in to join this conversation.
No Label
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: BogdanNagirniak/blender#63
No description provided.