Skip to content

Commit

Permalink
Merge pull request #452 from google/fix_shared_nmake_build
Browse files Browse the repository at this point in the history
Fix NMake builds with BUILD_SHARED_LIBS enabled.
  • Loading branch information
FrankGalligan authored Aug 15, 2018
2 parents e3a9d6c + 5c15f38 commit c93f507
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ option(BUILD_UNITY_PLUGIN "Build plugin library for Unity" OFF)
option(BUILD_FOR_GLTF "" 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)
# Override settings when building for GLTF.
draco_enable_feature(FEATURE "DRACO_MESH_COMPRESSION_SUPPORTED")
Expand Down Expand Up @@ -115,14 +120,14 @@ if (BUILD_MAYA_PLUGIN)
draco_enable_feature(FEATURE "BUILD_MAYA_PLUGIN")
endif ()

if(ENABLE_EXTRA_SPEED)
if (ENABLE_EXTRA_SPEED)
if(MSVC)
# Maximum optimization in Release mode.
add_compile_options("$<$<CONFIG:RELEASE>:/Ox>")
else()
add_compiler_flag_if_supported("-O3")
endif()
endif()
endif ()

# Generate a version file containing repository info.
include(FindGit)
Expand Down

0 comments on commit c93f507

Please sign in to comment.