Skip to content

Commit

Permalink
Merge pull request #994 from kmilos/kmilos/cmake_libcpp
Browse files Browse the repository at this point in the history
CMake: detect C++ library for pkgconf file
  • Loading branch information
farindk authored Oct 17, 2023
2 parents 18d4e55 + 68dfa90 commit 28f61b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,14 @@ if (LIBSHARPYUV_FOUND)
endif()
list(JOIN REQUIRES_PRIVATE " " REQUIRES_PRIVATE)

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

configure_file(libheif.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libheif.pc @ONLY)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libheif.pc
Expand Down
2 changes: 1 addition & 1 deletion libheif.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ Version: @PROJECT_VERSION@
Requires:
Requires.private: @REQUIRES_PRIVATE@
Libs: -L${libdir} -lheif
Libs.private: @LIBS@
Libs.private: @LIBS_PRIVATE@
Cflags: -I${includedir}

0 comments on commit 28f61b1

Please sign in to comment.