mirror of
https://git.mirrors.martin98.com/https://github.com/google/draco
synced 2025-08-11 19:59:01 +08:00
Support building mingw static and dynamic at the same time (#677)
Restrict the behavior disallowing the build of both libraries to MSVC. The mingw CMake generators handle the situation properly: - Shared library suffix: .dll - Import library suffix: .a.dll - Static library suffix: .a
This commit is contained in:
parent
3ea441ec1c
commit
253059c639
@ -804,7 +804,7 @@ else()
|
|||||||
draco_points_enc)
|
draco_points_enc)
|
||||||
|
|
||||||
# Library targets that consume the object collections.
|
# Library targets that consume the object collections.
|
||||||
if(MSVC OR WIN32)
|
if(MSVC)
|
||||||
# In order to produce a DLL and import library the Windows tools require
|
# In order to produce a DLL and import library the Windows tools require
|
||||||
# that the exported symbols are part of the DLL target. The unfortunate side
|
# that the exported symbols are part of the DLL target. The unfortunate side
|
||||||
# effect of this is that a single configuration cannot output both the
|
# effect of this is that a single configuration cannot output both the
|
||||||
|
@ -6,7 +6,7 @@ set(DRACO_CMAKE_DRACO_BUILD_DEFINITIONS_CMAKE_ 1)
|
|||||||
# Utility for controlling the main draco library dependency. This changes in
|
# Utility for controlling the main draco library dependency. This changes in
|
||||||
# shared builds, and when an optional target requires a shared library build.
|
# shared builds, and when an optional target requires a shared library build.
|
||||||
macro(set_draco_target)
|
macro(set_draco_target)
|
||||||
if(MSVC OR WIN32)
|
if(MSVC)
|
||||||
set(draco_dependency draco)
|
set(draco_dependency draco)
|
||||||
set(draco_plugin_dependency ${draco_dependency})
|
set(draco_plugin_dependency ${draco_dependency})
|
||||||
else()
|
else()
|
||||||
|
@ -55,7 +55,7 @@ macro(draco_setup_install_target)
|
|||||||
install(TARGETS draco_encoder DESTINATION
|
install(TARGETS draco_encoder DESTINATION
|
||||||
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
|
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
|
||||||
|
|
||||||
if(WIN32)
|
if(MSVC)
|
||||||
install(TARGETS draco DESTINATION
|
install(TARGETS draco DESTINATION
|
||||||
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
|
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
|
||||||
else()
|
else()
|
||||||
|
@ -164,8 +164,8 @@ endmacro()
|
|||||||
# cmake-format: off
|
# cmake-format: off
|
||||||
# - OUTPUT_NAME: Override output file basename. Target basename defaults to
|
# - OUTPUT_NAME: Override output file basename. Target basename defaults to
|
||||||
# NAME. OUTPUT_NAME is ignored when BUILD_SHARED_LIBS is enabled and CMake
|
# NAME. OUTPUT_NAME is ignored when BUILD_SHARED_LIBS is enabled and CMake
|
||||||
# is generating a build for which MSVC or WIN32 are true. This is to avoid
|
# is generating a build for which MSVC is true. This is to avoid output
|
||||||
# output basename collisions with DLL import libraries.
|
# basename collisions with DLL import libraries.
|
||||||
# - TEST: Flag. Presence means treat library as a test.
|
# - TEST: Flag. Presence means treat library as a test.
|
||||||
# - DEFINES: List of preprocessor macro definitions.
|
# - DEFINES: List of preprocessor macro definitions.
|
||||||
# - INCLUDES: list of include directories for the target.
|
# - INCLUDES: list of include directories for the target.
|
||||||
@ -260,7 +260,7 @@ macro(draco_add_library)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(lib_OUTPUT_NAME)
|
if(lib_OUTPUT_NAME)
|
||||||
if(NOT (BUILD_SHARED_LIBS AND (MSVC OR WIN32)))
|
if(NOT (BUILD_SHARED_LIBS AND MSVC))
|
||||||
set_target_properties(${lib_NAME}
|
set_target_properties(${lib_NAME}
|
||||||
PROPERTIES OUTPUT_NAME ${lib_OUTPUT_NAME})
|
PROPERTIES OUTPUT_NAME ${lib_OUTPUT_NAME})
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user