From 5bf650555c736b2a6c6ef7db126d38070a292d8f Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Wed, 10 Jul 2019 12:10:22 -0700 Subject: [PATCH] draco cmake: Defer windows shared lib check until after plugin checks. We rely upon CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS for windows DLL support, but we must defer the BUILD_SHARED_LIBS check until after the plugin args are checked since the plugin checks can enable BUILD_SHARED_LIBS. Without this change Visual Studio will not create import libs for the draco DLLs, and that breaks the build. --- CMakeLists.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d59725..7948cbf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,11 +56,6 @@ option(BUILD_FOR_GLTF "" OFF) option(BUILD_MAYA_PLUGIN "Build plugin library for Maya." OFF) option(BUILD_USD_PLUGIN "Build plugin library for USD." OFF) -if(WIN32 AND BUILD_SHARED_LIBS) - set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) - include(GenerateExportHeader) -endif() - if(BUILD_FOR_GLTF) # Override settings when building for GLTF. draco_enable_feature(FEATURE "DRACO_MESH_COMPRESSION_SUPPORTED") @@ -137,6 +132,10 @@ if(BUILD_USD_PLUGIN) draco_enable_feature(FEATURE "BUILD_USD_PLUGIN") endif() +if(WIN32 AND BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) +endif() + if(ENABLE_EXTRA_SPEED) if(MSVC) # Maximum optimization in Release mode.