Skip to content

Commit

Permalink
Fixed libplug CMakeLists.txt to work when tests are disabled.
Browse files Browse the repository at this point in the history
Fixes #183.

(Internal change: 1732261)
  • Loading branch information
pixar-oss committed Apr 4, 2017
1 parent 58307c3 commit 4f23073
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions pxr/base/lib/plug/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,18 @@ pxr_build_test_shared_lib(TestPlugDsoUnloadable
# but some linkers by default will error out when building this due
# to the references to undefined symbols. So we need to specify a
# link flag to force these symbols to be looked up at runtime.
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set_target_properties(TestPlugDsoUnloadable
PROPERTIES
LINK_FLAGS "-undefined dynamic_lookup"
)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
set_target_properties(TestPlugDsoUnloadable
PROPERTIES
LINK_FLAGS "/FORCE:UNRESOLVED"
)
if (PXR_BUILD_TESTS)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set_target_properties(TestPlugDsoUnloadable
PROPERTIES
LINK_FLAGS "-undefined dynamic_lookup"
)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
set_target_properties(TestPlugDsoUnloadable
PROPERTIES
LINK_FLAGS "/FORCE:UNRESOLVED"
)
endif()
endif()

pxr_create_test_module(TestPlugModule1
Expand Down

0 comments on commit 4f23073

Please sign in to comment.