Skip to content

Commit

Permalink
Fix Monolithic build on Windows
Browse files Browse the repository at this point in the history
Configure MaterialX with MATERIALX_BUILD_MONOLITHIC=ON on Windows, building this with with VS2022 causes couple issues:
1. error C1128: number of sections exceeded object file format
  fixed by adding /bigobj flag
2. Linker error from MaterialX_v1_39_0::OiioImageLoader::saveImage()
  fixed by muting OiioImageLoader using MATERIALX_BUILD_OIIO
  • Loading branch information
ashwinbhat committed Jun 6, 2024
1 parent 6c288c0 commit 6f348b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ endif()
# Adjust compiler settings
if(MSVC)
add_compile_options(/MP)
add_compile_options(/bigobj)
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else()
Expand Down
5 changes: 3 additions & 2 deletions source/MaterialXRender/OiioImageLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

#ifndef MATERIALX_OIIOIMAGELOADER_H
#define MATERIALX_OIIOIMAGELOADER_H


#if MATERIALX_BUILD_OIIO
/// @file
/// Image loader wrapper using OpenImageIO

Expand Down Expand Up @@ -55,5 +56,5 @@ class MX_RENDER_API OiioImageLoader : public ImageLoader
};

MATERIALX_NAMESPACE_END

#endif //MATERIALX_BUILD_OIIO
#endif

0 comments on commit 6f348b4

Please sign in to comment.