Revision: 77599
          http://sourceforge.net/p/brlcad/code/77599
Author:   starseeker
Date:     2020-10-23 13:46:07 +0000 (Fri, 23 Oct 2020)
Log Message:
-----------
Pull in improvements to BRLCAD_Targets.cmake from thirdparty_rework - in 
particular, set obj target dependencies and remove the pre-CMake 3.6 workaround.

Modified Paths:
--------------
    brlcad/branches/extbuild/misc/CMake/BRLCAD_Targets.cmake

Modified: brlcad/branches/extbuild/misc/CMake/BRLCAD_Targets.cmake
===================================================================
--- brlcad/branches/extbuild/misc/CMake/BRLCAD_Targets.cmake    2020-10-23 
13:40:59 UTC (rev 77598)
+++ brlcad/branches/extbuild/misc/CMake/BRLCAD_Targets.cmake    2020-10-23 
13:46:07 UTC (rev 77599)
@@ -448,6 +448,20 @@
       set_property(TARGET ${libname}-obj APPEND PROPERTY COMPILE_DEFINITIONS 
"${UPPER_CORE}_DLL_EXPORTS")
     endif(HIDE_INTERNAL_SYMBOLS)
 
+    # If the library depends on other targets in this build, not just system
+    # libraries, make sure the object targets depends them as well.  In
+    # principle this isn't always required - object compilation may be
+    # independent of the dependencies needed at link time - but if compilation
+    # DOES depends on those targets having first performed some action (like
+    # staging a header in an expected location) NOT setting this dependency
+    # explicitly will eventually cause build failures.
+    #
+    # Without setting the OBJECT dependencies, success in the above case would
+    # depend on whether or not the high level build ordering happened to run
+    # the required targets before performing this step.  That failure mode is
+    # semi-random and intermittent (top level build ordering without explicit
+    # dependencies varies depending on -j flag values) making it hard to debug.
+    # Ask me how I know.
     if(NOT "${libslist}" STREQUAL "" AND NOT "${libslist}" STREQUAL "NONE")
       foreach(ll ${libslist})
        if (TARGET ${ll})
@@ -655,24 +669,21 @@
     if (NOT IS_LOCAL)
       IS_SUBPATH("${BRLCAD_BINARY_DIR}" "${abs_inc_dir}" IS_LOCAL)
     endif (NOT IS_LOCAL)
-    if("${inc_dir}" MATCHES "other" OR NOT IS_LOCAL)
-      # Unfortunately, a bug in the CMake SYSTEM option to
-      # include_directories requires that these variables
-      # be explicitly set on OSX until we can require CMake
-      # version 3.6 - see
-      # https://public.kitware.com/Bug/view.php?id=15953
-      if(APPLE)
-       set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
-       set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
-      endif(APPLE)
-      if("${inc_dir}" MATCHES "other")
+    set(IS_SYSPATH 0)
+    foreach(sp ${SYS_INCLUDE_PATTERNS})
+      if("${inc_dir}" MATCHES "${sp}")
+       set(IS_SYSPATH 1)
+      endif("${inc_dir}" MATCHES "${sp}")
+    endforeach(sp ${SYS_INCLUDE_PATTERNS})
+    if(IS_SYSPATH OR NOT IS_LOCAL)
+      if(IS_SYSPATH)
        include_directories(SYSTEM ${inc_dir})
-      else("${inc_dir}" MATCHES "other")
+      else(IS_SYSPATH)
        include_directories(AFTER SYSTEM ${inc_dir})
-      endif("${inc_dir}" MATCHES "other")
-    else("${inc_dir}" MATCHES "other" OR NOT IS_LOCAL)
+      endif(IS_SYSPATH)
+    else(IS_SYSPATH OR NOT IS_LOCAL)
       include_directories(BEFORE ${inc_dir})
-    endif("${inc_dir}" MATCHES "other" OR NOT IS_LOCAL)
+    endif(IS_SYSPATH OR NOT IS_LOCAL)
   endforeach(inc_dir ${ALL_INCLUDES})
 
 endfunction(BRLCAD_INCLUDE_DIRS DIR_LIST)

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



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to