diff --git a/CMakeLists.txt b/CMakeLists.txt index 44135930d..8cbd5227a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,12 +187,22 @@ add_subdirectory(src/common) if (SYSTEM_LIBSEXP) find_package(PkgConfig) pkg_check_modules(REQUIRED sexp>=0.8.5) -else() +else (SYSTEM_LIBSEXP) +# cannot build shared lib(dll) with MSVC for now + if (MSVC) + set(SAVED_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) + set(BUILD_SHARED_LIBS OFF) + endif (MSVC) + set(WITH_SEXP_CLI OFF) set(WITH_SEXP_TESTS OFF) set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME development) add_subdirectory(src/libsexp EXCLUDE_FROM_ALL) -endif() + + if (MSVC) + set(BUILD_SHARED_LIBS ${SAVED_BUILD_SHARED_LIBS}) + endif (MSVC) +endif (SYSTEM_LIBSEXP) add_subdirectory(src/lib) add_subdirectory(src/rnp) diff --git a/ci/tests/deb-tests.sh b/ci/tests/deb-tests.sh index 356302238..a4dce003d 100755 --- a/ci/tests/deb-tests.sh +++ b/ci/tests/deb-tests.sh @@ -39,10 +39,12 @@ DIR_CMAKE="$INSTALL_PREFIX/lib/x86_64-linux-gnu/cmake/rnp" declare expected_libraries=( "$DIR_LIB/librnp.so.0" + "$DIR_LIB/libsexp.so.0" ) declare expected_devlibraries=( "$DIR_LIB/librnp.so" + "$DIR_LIB/libsexp.so.0" "$DIR_LIB/pkgconfig/librnp.pc" ) diff --git a/ci/tests/pkg-tests.sh b/ci/tests/pkg-tests.sh index dcc4d0147..9f59213f6 100755 --- a/ci/tests/pkg-tests.sh +++ b/ci/tests/pkg-tests.sh @@ -39,10 +39,12 @@ DIR_CMAKE="$INSTALL_PREFIX/lib/cmake/rnp" declare expected_libraries=( "$DIR_LIB/librnp.so.0" + "$DIR_LIB/libsexp.so.0" ) declare expected_devlibraries=( "$DIR_LIB/librnp.so" + "$DIR_LIB/libsexp.so.0" "$DIR_LIB/pkgconfig/librnp.pc" ) diff --git a/ci/tests/rpm-tests.sh b/ci/tests/rpm-tests.sh index 75b676e98..2829f7f47 100755 --- a/ci/tests/rpm-tests.sh +++ b/ci/tests/rpm-tests.sh @@ -46,10 +46,12 @@ DIR_CMAKE="$INSTALL_PREFIX/lib64/cmake/rnp" declare expected_libraries=( "$DIR_LIB/librnp.so.0" + "$DIR_LIB/libsexp.so.0" ) declare expected_devlibraries=( "$DIR_LIB/librnp.so" + "$DIR_LIB/libsexp.so.0" "$DIR_LIB/pkgconfig/librnp.pc" ) diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index d931701a5..ba81e1ccc 100755 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -435,8 +435,14 @@ endif() # If a client application uses static rnp library, it still needs libsexp.a and it is installed if (BUILD_SHARED_LIBS) + if (NOT SYSTEM_LIBSEXP AND NOT MSVC) + set (SEXP_INSTALL_TARGET "sexp") + else (NOT SYSTEM_LIBSEXP AND NOT MSVC) + set (SEXP_INSTALL_TARGET "") + endif (NOT SYSTEM_LIBSEXP AND NOT MSVC) + # both static and shared libraries -install(TARGETS librnp +install(TARGETS librnp ${SEXP_INSTALL_TARGET} EXPORT rnp-targets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" @@ -449,7 +455,7 @@ install(TARGETS librnp # install dll only for windows if (WIN32) - install(TARGETS librnp + install(TARGETS librnp ${SEXP_INSTALL_TARGET} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT runtime diff --git a/src/libsexp b/src/libsexp index b6bf03369..47009ce30 160000 --- a/src/libsexp +++ b/src/libsexp @@ -1 +1 @@ -Subproject commit b6bf0336904d8d8e0c169236e56cf55075fe4d36 +Subproject commit 47009ce300ddc2eabbdcd3a822cbfa1fbb5cf2b4