Skip to content

Commit

Permalink
Merge pull request #436 from meowtec/fix/libs-private-stdcpp
Browse files Browse the repository at this point in the history
Fix private libraries if build with clang
  • Loading branch information
farindk authored Nov 23, 2023
2 parents 7065a53 + 510abe6 commit a1e7f92
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ if(CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
add_definitions(-Wall)
endif()

include(CheckCXXSymbolExists)
check_cxx_symbol_exists(_LIBCPP_VERSION cstdlib HAVE_LIBCPP)
if(HAVE_LIBCPP)
set(LIBS_PRIVATE "-lc++")
else()
set(LIBS_PRIVATE "-lstdc++")
endif()

option(BUILD_SHARED_LIBS "Build shared library" ON)
if(NOT BUILD_SHARED_LIBS)
add_definitions(-DLIBDE265_STATIC_BUILD)
Expand Down
4 changes: 2 additions & 2 deletions libde265.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Name: libde265
Description: H.265/HEVC video decoder.
URL: https://github.com/strukturag/libde265
Version: @VERSION@
Requires:
Requires:
Libs: -lde265 -L${libdir}
Libs.private: @LIBS@ -lstdc++
Libs.private: @LIBS_PRIVATE@
Cflags: -I${includedir}

0 comments on commit a1e7f92

Please sign in to comment.