diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-04-17 20:58:01 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-04-17 20:58:01 +0000 |
| commit | cdbecda42af8a2f2d7e71915079af81c54746790 (patch) | |
| tree | 87db5bae4cb5ca9f6a22d90f95678b0187d7905e /llvm | |
| parent | 724c5034997f49b54d46727d842923f434e79fd8 (diff) | |
| download | bcm5719-llvm-cdbecda42af8a2f2d7e71915079af81c54746790.tar.gz bcm5719-llvm-cdbecda42af8a2f2d7e71915079af81c54746790.zip | |
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.
llvm-svn: 266571
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/cmake/modules/HandleLLVMOptions.cmake | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake index 9b9e4bf5422..cc945e1e0cc 100644 --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -139,25 +139,6 @@ function(add_flag_or_print_warning flag name) 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) |

