Browse Source

Add COMPOSITE_SOURCE_EXCLUSIONS option

It specifies a list of targets to exclude during the compositing stage.
Donny Lawrence 7 years ago
parent
commit
cddd553d1e
2 changed files with 15 additions and 2 deletions
  1. 5 0
      .travis.yml
  2. 10 2
      cmake/macros/CompositeSources.cmake

+ 5 - 0
.travis.yml

@@ -13,7 +13,12 @@ env:
 - BUILD_METALIBS=OFF COMPOSITE_SOURCE_LIMIT=30
 - BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=0
 matrix:
+  exclude:
+    - os: osx
+      env: BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=0
   include:
+    - os: osx
+      env: BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=30 COMPOSITE_SOURCE_EXCLUSIONS=p3showbase;p3dtoolutil;p3cocoadisplay;p3osxdisplay;p3tinydisplay;p3display
     - compiler: gcc
 
 addons:

+ 10 - 2
cmake/macros/CompositeSources.cmake

@@ -26,6 +26,10 @@ build dramatically but will be more memory intensive than a low value.")
 set(COMPOSITE_SOURCE_EXTENSIONS "cxx;c;mm" CACHE STRING
   "Only files of these extensions will be added to composite files.")
 
+set(COMPOSITE_SOURCE_EXCLUSIONS "" CACHE STRING
+  "A list of targets to skip when compositing sources. This is mainly
+desirable for CI builds.")
+
 set(COMPOSITE_GENERATOR "${CMAKE_SOURCE_DIR}/cmake/scripts/MakeComposite.cmake")
 
 
@@ -36,8 +40,12 @@ function(composite_sources target sources_var)
   set(sources ${orig_sources})
   list(LENGTH sources num_sources)
 
-  if(num_sources LESS 2 OR ${COMPOSITE_SOURCE_LIMIT} LESS 2)
-    # It's silly to do this for a single source.
+  # Don't composite if in the list of exclusions, and don't bother compositing
+  # with too few sources
+  list (FIND COMPOSITE_SOURCE_EXCLUSIONS ${target} _index)
+  if(num_sources LESS 2 
+    OR ${COMPOSITE_SOURCE_LIMIT} LESS 2
+    OR ${_index} GREATER -1)
     return()
   endif()