Fix build of dependents with gcc when using Apple linker. Part of: https://github.com/pothosware/SoapySDR/commit/f8d57652d12f9d212f373a81e493eba1a0b058c5 --- cmake/Modules/SoapySDRUtil.cmake.orig +++ cmake/Modules/SoapySDRUtil.cmake @@ -100,7 +100,11 @@ function(SOAPY_SDR_MODULE_UTIL) if(CMAKE_COMPILER_IS_GNUCXX) #force a compile-time error when symbols are missing #otherwise modules will cause a runtime error on load - target_link_libraries(${MODULE_TARGET} PRIVATE "-Wl,--no-undefined") + if(APPLE) + target_link_libraries(${MODULE_TARGET} PRIVATE "-Wl,-undefined,error") + else() + target_link_libraries(${MODULE_TARGET} PRIVATE "-Wl,--no-undefined") + endif() endif() if (NOT MODULE_DESTINATION)