Merge pull request #452 from google/fix_shared_nmake_build

Fix NMake builds with BUILD_SHARED_LIBS enabled.
This commit is contained in:
FrankGalligan 2018-08-15 09:04:52 -07:00 committed by GitHub
commit c93f5074c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,11 @@ option(BUILD_UNITY_PLUGIN "Build plugin library for Unity" OFF)
option(BUILD_FOR_GLTF "" OFF) option(BUILD_FOR_GLTF "" OFF)
option(BUILD_MAYA_PLUGIN "Build plugin library for Maya" OFF) option(BUILD_MAYA_PLUGIN "Build plugin library for Maya" OFF)
if (WIN32 AND BUILD_SHARED_LIBS)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
include(GenerateExportHeader)
endif ()
if (BUILD_FOR_GLTF) if (BUILD_FOR_GLTF)
# Override settings when building for GLTF. # Override settings when building for GLTF.
draco_enable_feature(FEATURE "DRACO_MESH_COMPRESSION_SUPPORTED") draco_enable_feature(FEATURE "DRACO_MESH_COMPRESSION_SUPPORTED")
@ -115,14 +120,14 @@ if (BUILD_MAYA_PLUGIN)
draco_enable_feature(FEATURE "BUILD_MAYA_PLUGIN") draco_enable_feature(FEATURE "BUILD_MAYA_PLUGIN")
endif () endif ()
if(ENABLE_EXTRA_SPEED) if (ENABLE_EXTRA_SPEED)
if(MSVC) if(MSVC)
# Maximum optimization in Release mode. # Maximum optimization in Release mode.
add_compile_options("$<$<CONFIG:RELEASE>:/Ox>") add_compile_options("$<$<CONFIG:RELEASE>:/Ox>")
else() else()
add_compiler_flag_if_supported("-O3") add_compiler_flag_if_supported("-O3")
endif() endif()
endif() endif ()
# Generate a version file containing repository info. # Generate a version file containing repository info.
include(FindGit) include(FindGit)