Skip to content

Commit fe022fc

Browse files
committed
fix: Allow to disable so-version
1 parent 0600a3c commit fe022fc

File tree

5 files changed

+23
-7
lines changed

5 files changed

+23
-7
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [0.5.5](https://github.com/rdkcentral/firebolt-cpp-client/compare/v0.5.4...v0.5.5)
2+
3+
### Changed
4+
- Allow building without a SONAME
5+
16
## [0.5.4](https://github.com/rdkcentral/firebolt-cpp-client/compare/v0.5.3...v0.5.4)
27

38
### Fixed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ option(DISCOVER_UT "Discover all Unit Tests" ON)
3030
option(DISCOVER_CT "Discover all Component Tests" OFF)
3131
option(ENABLE_DEMO_APP "Build demo app" OFF)
3232
option(BUILD_WITH_INSTALLED_TRANSPORT "Build the library with the transport that is installed, even if its version mismatches" ON)
33+
option(DISABLE_SO_VERSION "Disable SONAME/SOVERSION of shared library" OFF)
3334

3435
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
3536
set(CMAKE_INSTALL_PREFIX "${SYSROOT_PATH}/usr" CACHE INTERNAL "" FORCE)

build.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,21 @@ while [[ ! -z $1 ]]; do
5151
esac; shift
5252
done
5353

54-
[ ! -z $SYSROOT_PATH ] || { echo "SYSROOT_PATH not set" >/dev/stderr; exit 1; }
55-
[ -e $SYSROOT_PATH ] || { echo "SYSROOT_PATH not exist ($SYSROOT_PATH)" >/dev/stderr; exit 1; }
54+
[[ ! -z $SYSROOT_PATH ]] || { echo "SYSROOT_PATH not set" >/dev/stderr; exit 1; }
55+
[[ -e $SYSROOT_PATH ]] || { echo "SYSROOT_PATH not exist ($SYSROOT_PATH)" >/dev/stderr; exit 1; }
5656

5757
$cleanFirst && rm -rf $bdir
5858

59-
if [ ! -e "$bdir" ]; then
59+
if [[ ! -e "$bdir" || -n "$@" ]]; then
60+
params+=" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
61+
which ccache >/dev/null 2>&1 && params+=" -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
6062
cmake -B $bdir \
6163
-DCMAKE_BUILD_TYPE=$buildType \
6264
-DSYSROOT_PATH=$SYSROOT_PATH \
6365
$params \
6466
"$@" || exit $?
6567
fi
6668
cmake --build $bdir --parallel || exit $?
67-
if $do_install && [ $bdir = 'build' ]; then
69+
if $do_install && [[ $bdir == 'build' ]]; then
6870
cmake --install $bdir || exit $?
6971
fi

src/CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ target_link_libraries(${TARGET}
5454
PRIVATE
5555
nlohmann_json::nlohmann_json
5656
PUBLIC
57-
$<IF:$<TARGET_EXISTS:FireboltTransport::FireboltTransport>,FireboltTransport::FireboltTransport,FireboltTransport>
57+
FireboltTransport::FireboltTransport
5858
)
5959

6060
target_include_directories(${TARGET}
@@ -70,9 +70,17 @@ set_target_properties(${TARGET} PROPERTIES
7070
CXX_STANDARD 17
7171
CXX_STANDARD_REQUIRED YES
7272
VERSION ${PROJECT_VERSION}
73-
SOVERSION ${PROJECT_VERSION_MAJOR}
7473
POSITION_INDEPENDENT_CODE ON
7574
)
75+
if(DISABLE_SO_VERSION)
76+
set_target_properties(${TARGET} PROPERTIES
77+
NO_SONAME ON
78+
)
79+
else()
80+
set_target_properties(${TARGET} PROPERTIES
81+
SOVERSION ${PROJECT_VERSION_MAJOR}
82+
)
83+
endif()
7684

7785
write_basic_package_version_file(
7886
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ target_link_options(${UNIT_TESTS_APP} PRIVATE --coverage)
4141
target_link_libraries(${UNIT_TESTS_APP}
4242
PRIVATE
4343
FireboltClient
44-
$<IF:$<TARGET_EXISTS:FireboltTransport::FireboltTransport>,FireboltTransport::FireboltTransport,FireboltTransport>
44+
FireboltTransport::FireboltTransport
4545
nlohmann_json::nlohmann_json
4646
nlohmann_json_schema_validator::validator
4747
GTest::gtest

0 commit comments

Comments
 (0)