shithub: m8c

Download patch

ref: 028cf54d5be6a1acac9383e21cd4a70519244190
parent: cc3dee8aa844b874aa9b8495c36d07efd51ce030
author: Maido Käära <maido@producement.com>
date: Thu Feb 23 11:35:06 EST 2023

Fix linking

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,9 +1,5 @@
 cmake_minimum_required(VERSION 3.15)
 
-if (APPLE)
-    link_directories(/opt/homebrew/lib)
-endif ()
-
 project(m8c C)
 
 find_package(PkgConfig REQUIRED)
@@ -11,8 +7,11 @@
 pkg_check_modules(SDL2 REQUIRED sdl2)
 if (USE_LIBUSB)
     pkg_check_modules(LIBUSB REQUIRED libusb)
+    link_directories(${SDL2_LIBRARY_DIRS} ${LIBUSB_LIBRARY_DIRS})
+    add_compile_definitions(USE_LIBUSB)
 else ()
     pkg_check_modules(LIBSERIALPORT REQUIRED libserialport)
+    link_directories(${SDL2_LIBRARY_DIRS} ${LIBSERIALPORT_LIBRARY_DIRS})
 endif (USE_LIBUSB)
 
 string(CONCAT FILE_CONTENT "#include <SDL.h>")
@@ -51,4 +50,5 @@
     target_link_libraries(m8c ${LIBSERIALPORT_LIBRARIES})
     target_include_directories(m8c PUBLIC ${LIBSERIALPORT_INCLUDE_DIRS})
     target_compile_options(m8c PUBLIC ${LIBSERIALPORT_CFLAGS_OTHER})
-endif ()
\ No newline at end of file
+endif ()
+
--