cmake: a couple of fixes to the build system

This commit is contained in:
Michele Caini 2024-10-18 17:31:54 +02:00
parent fb2f8d9eff
commit f70a0dbc2b

View File

@ -65,14 +65,14 @@ if (UVW_BUILD_SHARED_LIB)
add_library(uvw SHARED) add_library(uvw SHARED)
add_library(uvw::uvw-shared ALIAS uvw) add_library(uvw::uvw-shared ALIAS uvw)
# If libuv is not fetched by ourselves, it's the caller's responsibility to make sure of the linkage. # If libuv is not fetched by ourselves, it's the caller's responsibility to make sure of the linkage.
if(FETCH_LIBUV OR libuv_FOUND) if(UVW_FETCH_LIBUV OR libuv_FOUND)
target_link_libraries(uvw PUBLIC uv::uv-shared) target_link_libraries(uvw PUBLIC uv::uv-shared)
endif() endif()
else() else()
add_library(uvw STATIC) add_library(uvw STATIC)
add_library(uvw::uvw-static ALIAS uvw) add_library(uvw::uvw-static ALIAS uvw)
# If libuv is not fetched by ourselves, it's the caller's responsibility to make sure of the linkage. # If libuv is not fetched by ourselves, it's the caller's responsibility to make sure of the linkage.
if(FETCH_LIBUV OR libuv_FOUND) if(UVW_FETCH_LIBUV OR libuv_FOUND)
target_link_libraries(uvw PUBLIC uv::uv-static) target_link_libraries(uvw PUBLIC uv::uv-static)
endif() endif()
endif() endif()