diff --git a/CMakeLists.txt b/CMakeLists.txt index 82e0c5c8573..3d99626a506 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,9 +73,22 @@ if(CMAKE_HOST_APPLE AND APPLE) if(CMAKE_LIBTOOL) set(CMAKE_LIBTOOL ${CMAKE_LIBTOOL} CACHE PATH "libtool executable") message(STATUS "Found libtool - ${CMAKE_LIBTOOL}") + + execute_process(COMMAND ${CMAKE_LIBTOOL} -V + OUTPUT_VARIABLE LIBTOOL_V_OUTPUT + OUTPUT_STRIP_TRAILING_WHITESPACE) + if("${LIBTOOL_V_OUTPUT}" MATCHES ".*cctools-([0-9.]+).*") + string(REGEX REPLACE ".*cctools-([0-9.]+).*" "\\1" LIBTOOL_VERSION + ${LIBTOOL_V_OUTPUT}) + if(NOT LIBTOOL_VERSION VERSION_LESS "862") + set(LIBTOOL_NO_WARNING_FLAG "-no_warning_for_no_symbols") + endif() + endif() + foreach(lang ${languages}) set(CMAKE_${lang}_CREATE_STATIC_LIBRARY - "${CMAKE_LIBTOOL} -static -o ") + "${CMAKE_LIBTOOL} -static ${LIBTOOL_NO_WARNING_FLAG} -o \ + ") endforeach() endif()