refactor(build): graduate unibilium VAR_FROM feature from 2017

This commit is contained in:
bfredl
2023-02-27 19:51:25 +01:00
committed by Björn Linse
parent c9b6db4541
commit 848dac0aaa
2 changed files with 2 additions and 33 deletions

View File

@ -8,22 +8,4 @@ add_library(unibilium INTERFACE)
target_include_directories(unibilium SYSTEM BEFORE INTERFACE ${UNIBILIUM_INCLUDE_DIR})
target_link_libraries(unibilium INTERFACE ${UNIBILIUM_LIBRARY})
list(APPEND CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIR}")
list(APPEND CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARY}")
check_c_source_compiles("
#include <unibilium.h>
int
main(void)
{
unibi_str_from_var(unibi_var_from_str(\"\"));
return unibi_num_from_var(unibi_var_from_num(0));
}
" UNIBI_HAS_VAR_FROM)
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIR}")
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARY}")
if(UNIBI_HAS_VAR_FROM)
target_compile_definitions(unibilium INTERFACE NVIM_UNIBI_HAS_VAR_FROM)
endif()
mark_as_advanced(UNIBILIUM_INCLUDE_DIR UNIBILIUM_LIBRARY)