diff options
author | Alexander Mohr <alexander.m.mohr@mercedes-benz.com> | 2023-05-17 09:09:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-17 09:09:53 +0200 |
commit | f64063bf1dff1f05f95b11d4571ad6416faa81ae (patch) | |
tree | 2aa57bc48e4b71307f939090f47caf7b01025c1e /CMakeLists.txt | |
parent | 6005b92b34b3e3ffe43c59be544acd4688a3354c (diff) | |
download | DLT-daemon-f64063bf1dff1f05f95b11d4571ad6416faa81ae.tar.gz |
build: add static lib only if necessary (#479)
adding static library should only be enabled
if the dlt library is build static.
Adding this to the automotive-dlt.pc.in
when static libraries are disabled
yocto build will break
Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 57044d6..ff53ceb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -209,6 +209,12 @@ else() set(PACKAGE_DOC "") endif() +if (BUILD_SHARED_LIBS) + set(CMAKE_STATIC_LIB_PATH "") +else() + set(CMAKE_STATIC_LIB_PATH "-L\$\{libdir\}/static") +endif() + if(WITH_DLT_PKGCONFIG) configure_file(${PROJECT_SOURCE_DIR}/${PROJECT_NAME}.spec.in ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.spec) configure_file(${PROJECT_SOURCE_DIR}/${PROJECT_NAME}.pc.in ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.pc @ONLY) |