diff --git a/.travis.yml b/.travis.yml index 54e25dffae..84810b2b01 100644 --- a/.travis.yml +++ b/.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: diff --git a/cmake/macros/CompositeSources.cmake b/cmake/macros/CompositeSources.cmake index ad0ac24a2e..adcb4ccfa7 100644 --- a/cmake/macros/CompositeSources.cmake +++ b/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()