[llvm] r266571 - When building with LLVM_ENABLE_MODULES, put the module cache into the build

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 08:46:20 PDT 2016


> On Apr 17, 2016, at 1:58 PM, Richard Smith via llvm-commits <llvm-commits at lists.llvm.org> wrote:
> 
> Author: rsmith
> Date: Sun Apr 17 15:58:01 2016
> New Revision: 266571
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=266571&view=rev
> Log:
> When building with LLVM_ENABLE_MODULES, put the module cache into the build
> directory. This is important for build bots to avoid filling up /tmp.

So instead of filling /tmp/ we're filling the build directory right? And it won't be shared between the various jobs anymore.
What about the pruning options? Not enabled? Should it be?

(I don't have concern, just curious)

-- 
Mehdi




> 
> Modified:
>    llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
> 
> Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=266571&r1=266570&r2=266571&view=diff
> ==============================================================================
> --- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
> +++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Sun Apr 17 15:58:01 2016
> @@ -139,25 +139,6 @@ function(add_flag_or_print_warning flag
>   endif()
> endfunction()
> 
> -if (LLVM_ENABLE_MODULES)
> -  set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
> -  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fmodules -Xclang -fmodules-local-submodule-visibility")
> -  # Check that we can build code with modules enabled, and that repeatedly
> -  # including <cassert> still manages to respect NDEBUG properly.
> -  CHECK_CXX_SOURCE_COMPILES("#undef NDEBUG
> -                             #include <cassert>
> -                             #define NDEBUG
> -                             #include <cassert>
> -                             int main() { assert(this code is not compiled); }"
> -                             CXX_SUPPORTS_MODULES)
> -  set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
> -  if (CXX_SUPPORTS_MODULES)
> -    append_if(CXX_SUPPORTS_MODULES "-fmodules -Xclang -fmodules-local-submodule-visibility" CMAKE_CXX_FLAGS)
> -  else()
> -    message(FATAL_ERROR "LLVM_ENABLE_MODULES is not supported by this compiler")
> -  endif()
> -endif(LLVM_ENABLE_MODULES)
> -
> if( LLVM_ENABLE_PIC )
>   if( XCODE )
>     # Xcode has -mdynamic-no-pic on by default, which overrides -fPIC. I don't
> @@ -490,6 +471,24 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE
>       message(FATAL_ERROR "LLVM requires C++11 support but the '-std=c++11' flag isn't supported.")
>     endif()
>   endif()
> +  if (LLVM_ENABLE_MODULES)
> +    set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
> +    set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fmodules -Xclang -fmodules-local-submodule-visibility -fmodules-cache-path=module.cache")
> +    # Check that we can build code with modules enabled, and that repeatedly
> +    # including <cassert> still manages to respect NDEBUG properly.
> +    CHECK_CXX_SOURCE_COMPILES("#undef NDEBUG
> +                               #include <cassert>
> +                               #define NDEBUG
> +                               #include <cassert>
> +                               int main() { assert(this code is not compiled); }"
> +                               CXX_SUPPORTS_MODULES)
> +    set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
> +    if (CXX_SUPPORTS_MODULES)
> +      append_if(CXX_SUPPORTS_MODULES "-fmodules -Xclang -fmodules-local-submodule-visibility -fmodules-cache-path=module.cache" CMAKE_CXX_FLAGS)
> +    else()
> +      message(FATAL_ERROR "LLVM_ENABLE_MODULES is not supported by this compiler")
> +    endif()
> +  endif(LLVM_ENABLE_MODULES)
> endif( MSVC )
> 
> macro(append_common_sanitizer_flags)
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list