Skip to content

Commit

Permalink
serial: Fix empty package and use shared lib instead of static lib.
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyel authored and kraj committed Apr 30, 2024
1 parent 01d3dca commit 224eb26
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
From 23ae981ba46f6d5af03b12083ad32de9c1f148b2 Mon Sep 17 00:00:00 2001
From: magicWenli <[email protected]>
Date: Fri, 12 Apr 2024 07:52:53 +0000
Subject: [PATCH] Add SOVERSION for shared lib, and comment example by default

Upstream-Status: Pending
---
CMakeLists.txt | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,8 @@
cmake_minimum_required(VERSION 2.8.3)
project(serial)
+set (SERIAL_VERSION_MAJOR 1)
+set (SERIAL_VERSION_MINOR 2)
+set (SERIAL_VERSION_PATCH 1)

# Find catkin
find_package(catkin REQUIRED)
@@ -45,7 +48,7 @@ else()
endif()

## Add serial library
-add_library(${PROJECT_NAME} ${serial_SRCS})
+add_library(${PROJECT_NAME} SHARED ${serial_SRCS})
if(APPLE)
target_link_libraries(${PROJECT_NAME} ${FOUNDATION_LIBRARY} ${IOKIT_LIBRARY})
elseif(UNIX)
@@ -55,9 +58,12 @@ else()
endif()

## Uncomment for example
-add_executable(serial_example examples/serial_example.cc)
-add_dependencies(serial_example ${PROJECT_NAME})
-target_link_libraries(serial_example ${PROJECT_NAME})
+# add_executable(serial_example examples/serial_example.cc)
+# add_dependencies(serial_example ${PROJECT_NAME})
+# target_link_libraries(serial_example ${PROJECT_NAME})
+
+set (SERIAL_VERSION_STRING ${SERIAL_VERSION_MAJOR}.${SERIAL_VERSION_MINOR}.${SERIAL_VERSION_PATCH})
+set_target_properties (${PROJECT_NAME} PROPERTIES VERSION ${SERIAL_VERSION_STRING} SOVERSION ${SERIAL_VERSION_MAJOR})

## Include headers
include_directories(include)
1 change: 1 addition & 0 deletions meta-oe/recipes-support/serial/serial_1.2.1.bb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://README.md;beginline=53;endline=62;md5=049c68d559533f9
SRC_URI = " \
git://github.com/wjwwood/${BPN}.git;protocol=https;branch=main \
file://Findcatkin.cmake \
file://0001-Add-SOVERSION-for-shared-lib-and-comment-example.patch \
"
SRCREV = "10ac4e1c25c2cda1dc0a32a8e12b87fd89f3bb4f"
SRC_URI[sha256sum] = "c8cd235dda2ef7d977ba06dfcb35c35e42f45cfd9149ba3ad257756123d8ff96"
Expand Down

0 comments on commit 224eb26

Please sign in to comment.