rename library check to find_link_library
This commit is contained in:
parent
f739e4f2c3
commit
9cd7e4cc68
@ -343,7 +343,7 @@ endif()
|
|||||||
|
|
||||||
# we prefer -l<lib> test over `find_library` as sometimes core libraries
|
# we prefer -l<lib> test over `find_library` as sometimes core libraries
|
||||||
# like `libatomic` are not on the system path (see issue #898)
|
# like `libatomic` are not on the system path (see issue #898)
|
||||||
function(add_link_library libname outlibname)
|
function(find_link_library libname outlibname)
|
||||||
check_linker_flag(C "-l${libname}" mi_has_lib${libname})
|
check_linker_flag(C "-l${libname}" mi_has_lib${libname})
|
||||||
if (mi_has_lib${libname})
|
if (mi_has_lib${libname})
|
||||||
message(VERBOSE "link library: -l${libname}")
|
message(VERBOSE "link library: -l${libname}")
|
||||||
@ -363,15 +363,15 @@ endfunction()
|
|||||||
if(WIN32)
|
if(WIN32)
|
||||||
list(APPEND mi_libraries psapi shell32 user32 advapi32 bcrypt)
|
list(APPEND mi_libraries psapi shell32 user32 advapi32 bcrypt)
|
||||||
else()
|
else()
|
||||||
add_link_library("pthread" MI_LIB_PTHREAD)
|
find_link_library("pthread" MI_LIB_PTHREAD)
|
||||||
if(MI_LIB_PTHREAD)
|
if(MI_LIB_PTHREAD)
|
||||||
list(APPEND mi_libraries "${MI_LIB_PTHREAD}")
|
list(APPEND mi_libraries "${MI_LIB_PTHREAD}")
|
||||||
endif()
|
endif()
|
||||||
add_link_library("rt" MI_LIB_RT)
|
find_link_library("rt" MI_LIB_RT)
|
||||||
if(MI_LIB_RT)
|
if(MI_LIB_RT)
|
||||||
list(APPEND mi_libraries "${MI_LIB_RT}")
|
list(APPEND mi_libraries "${MI_LIB_RT}")
|
||||||
endif()
|
endif()
|
||||||
add_link_library("atomic" MI_LIB_ATOMIC)
|
find_link_library("atomic" MI_LIB_ATOMIC)
|
||||||
if(MI_LIB_ATOMIC)
|
if(MI_LIB_ATOMIC)
|
||||||
list(APPEND mi_libraries "${MI_LIB_ATOMIC}")
|
list(APPEND mi_libraries "${MI_LIB_ATOMIC}")
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user