diff --git a/dlib/CMakeLists.txt b/dlib/CMakeLists.txt index 8fc43ec51..83230606f 100644 --- a/dlib/CMakeLists.txt +++ b/dlib/CMakeLists.txt @@ -136,10 +136,12 @@ endmacro() # Suppress superfluous randlib warnings about libdlib.a having no symbols on MacOSX. -if (APPLE) +if (CMAKE_C_COMPILER_ID STREQUAL "AppleClang") set(CMAKE_C_ARCHIVE_CREATE " Scr ") - set(CMAKE_CXX_ARCHIVE_CREATE " Scr ") set(CMAKE_C_ARCHIVE_FINISH " -no_warning_for_no_symbols -c ") +endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + set(CMAKE_CXX_ARCHIVE_CREATE " Scr ") set(CMAKE_CXX_ARCHIVE_FINISH " -no_warning_for_no_symbols -c ") endif()