From: Gregory Economou Date: Tue, 16 Apr 2024 10:09:05 +0000 (+0300) Subject: made the rpath finding a bit more flexible than just hardcoded gcc12 and gcc13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87b4787455a45b211805b2fbba2db92bfb4f6821;p=thirdparty%2Fvectorscan.git made the rpath finding a bit more flexible than just hardcoded gcc12 and gcc13 --- diff --git a/cmake/osdetection.cmake b/cmake/osdetection.cmake index 23f6a5d5..c163a7ff 100644 --- a/cmake/osdetection.cmake +++ b/cmake/osdetection.cmake @@ -5,11 +5,7 @@ endif(CMAKE_SYSTEM_NAME MATCHES "Linux") if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") set(FREEBSD true) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - if(CMAKE_C_COMPILER MATCHES "/usr/local/bin/gcc12") - set(CMAKE_BUILD_RPATH "/usr/local/lib/gcc12") - elseif(CMAKE_C_COMPILER MATCHES "/usr/local/bin/gcc13") - set(CMAKE_BUILD_RPATH "/usr/local/lib/gcc13") - endif() + execute_process(COMMAND "sh" "-c" "realpath `dirname \\`${CMAKE_C_COMPILER} --print-file-name=libgcc_s.so\\``" OUTPUT_VARIABLE CMAKE_BUILD_RPATH) endif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")