Skip to content

Commit

Permalink
Fix windows linking against shared dll for non-cmake projects (Academ…
Browse files Browse the repository at this point in the history
…ySoftwareFoundation#1067)

...by ensuring that MATERIALX_BUILD_SHARED_LIBS is defined.
  • Loading branch information
pmolodo authored Sep 3, 2022
1 parent a1f7f72 commit ce91328
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 0 additions & 4 deletions source/MaterialXCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ add_library(MaterialXCore ${materialx_source} ${materialx_headers})

add_definitions(-DMATERIALX_CORE_EXPORTS)

if (MATERIALX_BUILD_SHARED_LIBS)
target_compile_definitions(MaterialXCore PUBLIC -DMATERIALX_BUILD_SHARED_LIBS)
endif()

set_target_properties(
MaterialXCore PROPERTIES
OUTPUT_NAME MaterialXCore${MATERIALX_LIBNAME_SUFFIX}
Expand Down
2 changes: 2 additions & 0 deletions source/MaterialXCore/Generated.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#define MATERIALX_MINOR_VERSION @MATERIALX_MINOR_VERSION@
#define MATERIALX_BUILD_VERSION @MATERIALX_BUILD_VERSION@

#cmakedefine MATERIALX_BUILD_SHARED_LIBS

// Establish namespace:
namespace @MATERIALX_NAMESPACE@
{
Expand Down

0 comments on commit ce91328

Please sign in to comment.