Browse Source

Only do static libraries

master
Gavin Howard 4 years ago
parent
commit
751cd13a6e
Signed by: gavin GPG Key ID: C08038BDF280D33E
  1. 21
      functions.cmake

21
functions.cmake

@ -34,24 +34,11 @@ endfunction (create_test)
function (create_library name src doinstall)
# Do the shared library only on platforms other than Windows.
if (NOT WIN32)
set(SHARED_NAME "${name}_shared")
add_library("${SHARED_NAME}" SHARED "${src}")
set_target_properties("${SHARED_NAME}" PROPERTIES OUTPUT_NAME "${name}")
target_link_libraries("${SHARED_NAME}" "${ARGN}")
if (doinstall)
install(TARGETS "${SHARED_NAME}" LIBRARY DESTINATION lib/)
endif()
endif()
# Static library.
set(STATIC_NAME "${name}_static")
add_library("${STATIC_NAME}" STATIC "${src}")
set_target_properties("${STATIC_NAME}" PROPERTIES OUTPUT_NAME "${name}")
target_link_libraries("${STATIC_NAME}" "${ARGN}")
# Static library only.
add_library("${name}" STATIC "${src}")
target_link_libraries("${name}" "${ARGN}")
if (doinstall)
install(TARGETS "${STATIC_NAME}" ARCHIVE DESTINATION lib/)
install(TARGETS "${name}" ARCHIVE DESTINATION lib/)
endif()
endfunction (create_library)

Loading…
Cancel
Save