CMakeLists.txt
changeset 11320 6b36980ae340
parent 11312 ee47dce3b10c
child 11323 46861f3fc187
     1.1 --- a/CMakeLists.txt	Fri Aug 18 16:52:19 2017 -0400
     1.2 +++ b/CMakeLists.txt	Fri Aug 18 18:52:25 2017 -0400
     1.3 @@ -433,11 +433,15 @@
     1.4      list(APPEND EXTRA_CFLAGS "-Wshadow")
     1.5    endif()
     1.6  
     1.7 -  set(CMAKE_REQUIRED_FLAGS "-Wl,--no-undefined")
     1.8 -  check_c_compiler_flag("" HAVE_NO_UNDEFINED)
     1.9 -  set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
    1.10 -  if(HAVE_NO_UNDEFINED)
    1.11 -    list(APPEND EXTRA_LDFLAGS "-Wl,--no-undefined")
    1.12 +  if(APPLE)
    1.13 +    list(APPEND EXTRA_LDFLAGS "-Wl,-undefined,error")
    1.14 +  else()
    1.15 +    set(CMAKE_REQUIRED_FLAGS "-Wl,--no-undefined")
    1.16 +    check_c_compiler_flag("" HAVE_NO_UNDEFINED)
    1.17 +    set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
    1.18 +    if(HAVE_NO_UNDEFINED)
    1.19 +      list(APPEND EXTRA_LDFLAGS "-Wl,--no-undefined")
    1.20 +    endif()
    1.21    endif()
    1.22  endif()
    1.23