Don't include version info in the static library (#468)

The static library should not contain version info, since it would be linked into an executable or dll with its own version info.

Fix By: @marc-groundctl
pull/474/head
marc-groundctl 3 years ago committed by GitHub
parent 5aa25946e7
commit e20215ab93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/lib/CMakeLists.txt

@ -3,11 +3,6 @@
transform_makefile_inc("Makefile.inc" "${PROJECT_BINARY_DIR}/src/lib/Makefile.inc.cmake")
include(${PROJECT_BINARY_DIR}/src/lib/Makefile.inc.cmake)
# Include resource file in windows builds for versioned DLLs
IF (WIN32)
LIST (APPEND CSOURCES cares.rc)
ENDIF()
# Write ares_config.h configuration file. This is used only for the build.
CONFIGURE_FILE (ares_config.h.cmake ${PROJECT_BINARY_DIR}/ares_config.h)
@ -15,6 +10,11 @@ CONFIGURE_FILE (ares_config.h.cmake ${PROJECT_BINARY_DIR}/ares_config.h)
IF (CARES_SHARED)
ADD_LIBRARY (${PROJECT_NAME} SHARED ${CSOURCES})
# Include resource file in windows builds for versioned DLLs
IF (WIN32)
TARGET_SOURCES (${PROJECT_NAME} PRIVATE cares.rc)
ENDIF()
# Convert CARES_LIB_VERSIONINFO libtool version format into VERSION and SOVERSION
# Convert from ":" separated into CMake list format using ";"
STRING (REPLACE ":" ";" CARES_LIB_VERSIONINFO ${CARES_LIB_VERSIONINFO})

Loading…
Cancel
Save