Commit d337965e authored by erw7's avatar erw7

Change to not use library prefix on MSVC

parent 655e3167
......@@ -31,11 +31,7 @@ if(LIBUV_USE_STATIC)
"${CMAKE_STATIC_LIBRARY_PREFIX}uv${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif(LIBUV_USE_STATIC)
if(MSVC)
list(APPEND LIBUV_NAMES libuv)
else()
list(APPEND LIBUV_NAMES uv)
endif()
list(APPEND LIBUV_NAMES uv)
find_library(LIBUV_LIBRARY NAMES ${LIBUV_NAMES}
HINTS ${PC_LIBUV_LIBDIR} ${PC_LIBUV_LIBRARY_DIRS}
......
......@@ -4,18 +4,12 @@ project(libuv LANGUAGES C)
file(GLOB UV_SOURCES_COMMON src/*.c)
file(GLOB UV_SOURCES_WIN src/win/*.c)
if(MSVC)
set(LIBUV libuv)
else()
set(LIBUV uv)
endif()
add_library(${LIBUV} ${UV_SOURCES_COMMON} ${UV_SOURCES_WIN})
target_compile_definitions(${LIBUV} PRIVATE WIN32_LEAN_AND_MEAN "_WIN32_WINNT=0x0600")
target_link_libraries(${LIBUV} iphlpapi psapi shell32 userenv ws2_32)
target_include_directories(${LIBUV} PUBLIC ./include PRIVATE ./src)
add_library(uv ${UV_SOURCES_COMMON} ${UV_SOURCES_WIN})
target_compile_definitions(uv PRIVATE WIN32_LEAN_AND_MEAN "_WIN32_WINNT=0x0600")
target_link_libraries(uv iphlpapi psapi shell32 userenv ws2_32)
target_include_directories(uv PUBLIC ./include PRIVATE ./src)
if(BUILD_SHARED_LIBS)
set_target_properties(${LIBUV} PROPERTIES DEFINE_SYMBOL BUILDING_UV_SHARED)
set_target_properties(uv PROPERTIES DEFINE_SYMBOL BUILDING_UV_SHARED)
endif()
install(FILES
......@@ -28,7 +22,7 @@ install(FILES
DESTINATION include)
include(GNUInstallDirs)
install(TARGETS ${LIBUV}
install(TARGETS uv
PUBLIC_HEADER
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment