Revision: 70290
          http://sourceforge.net/p/brlcad/code/70290
Author:   brlcad
Date:     2017-09-17 04:43:18 +0000 (Sun, 17 Sep 2017)
Log Message:
-----------
clang prefers a different form for stopping on undefined and requires it on 
apple, so default to it when it instead of -Wl,--no-undefined

Modified Paths:
--------------
    brlcad/trunk/src/other/gdal/CMakeLists.txt

Modified: brlcad/trunk/src/other/gdal/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/other/gdal/CMakeLists.txt  2017-09-17 04:12:40 UTC (rev 
70289)
+++ brlcad/trunk/src/other/gdal/CMakeLists.txt  2017-09-17 04:43:18 UTC (rev 
70290)
@@ -177,9 +177,16 @@
   check_type_size(pthread_spinlock_t HAVE_PTHREAD_SPINLOCK)
 endif(CMAKE_USE_PTHREADS_INIT)
 
+# Clang usually matches GNU, but linker flags are different on Apple
+if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
+  set(fail_on_undefined_flag "Wl,--no-undefined")
+elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
+  set(fail_on_undefined_flag "Wl,-undefined,error")
+endif()
+
 # Make sure to put these after the other tests, so we don't
 # mess up the detections with Wl,--no-undefined
-set(cmp_flags "Wno-error" g O2 fPIC DPIC "Wl,--no-undefined" W4 wd4127 wd4251 
wd4275 wd4786 wd4100 wd4245 wd4206 wd4351 wd4611)
+set(cmp_flags "Wno-error" g O2 fPIC DPIC "${fail_on_undefined_flag}" W4 wd4127 
wd4251 wd4275 wd4786 wd4100 wd4245 wd4206 wd4351 wd4611)
 foreach(cf ${cmp_flags})
   check_c_compiler_flag(-${cf} ${cf}_FLAG_C)
   if(${cf}_FLAG_C)

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to