From ec17f896bc69f14064ba2b286fe0f6375e804a3e Mon Sep 17 00:00:00 2001 From: Marek Kraus Date: Wed, 5 Oct 2022 11:53:32 +0200 Subject: [PATCH] Add some macOS related stuff --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 992e7a4..9be19fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)