Add some macOS related stuff

This commit is contained in:
Marek Kraus 2022-10-05 11:53:32 +02:00
parent f7964a9cb2
commit ec17f896bc

View File

@ -50,6 +50,13 @@ elseif(UNIX AND NOT APPLE)
"SP_PRIV=__attribute__((visibility(\"hidden\")))")
target_include_directories(libblisp_obj PRIVATE ${CMAKE_SOURCE_DIR}/vendor/libserialport)
write_file(${CMAKE_SOURCE_DIR}/vendor/libserialport/config.h "// bypass errors.")
elseif(APPLE)
target_sources(libblisp_obj PRIVATE
${CMAKE_SOURCE_DIR}/vendor/libserialport/macosx.c)
target_link_libraries(libblisp_obj PRIVATE "-framework IOKit" "-framework CoreFoundation")
target_compile_definitions(libblisp_obj PRIVATE LIBSERIALPORT_ATBUILD "SP_API=__attribute__((visibility(\"default\")))")
target_include_directories(libblisp_obj PRIVATE ${CMAKE_SOURCE_DIR}/vendor/libserialport)
write_file(${CMAKE_SOURCE_DIR}/vendor/libserialport/config.h "// bypass errors.")
endif()
if(BLISP_BUILD_CLI)