[CMake] -fmodules-local-submodule-visibility is a cc1-only option.

This should fix modules builds on platforms other than Darwin after r274196.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274227 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vassil Vassilev 2016-06-30 14:17:42 +00:00
parent 1e7d61d581
commit 4112128cf7

View File

@ -465,13 +465,13 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
endif()
if (LLVM_ENABLE_MODULES)
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(module_flags "-fmodules -Xclang -fmodules-cache-path=module.cache")
set(module_flags "-fmodules -fmodules-cache-path=module.cache")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# On Darwin -fmodules does not imply -fcxx-modules.
set(module_flags "${module_flags} -fcxx-modules")
endif()
if (LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY)
set(module_flags "${module_flags} -fmodules-local-submodule-visibility")
set(module_flags "${module_flags} -Xclang -fmodules-local-submodule-visibility")
endif()
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${module_flags}")