[CMake] Add option (defaulted off) to exclude atomic.c

The atomic builtin source is problematic when cross-compiling builtins because it requires a variable and sometimes large set of system headers. This option allows users to optionally prevent it from being built.

llvm-svn: 280416
This commit is contained in:
Chris Bieneman 2016-09-01 21:05:49 +00:00
parent c0f18172f5
commit 90646fe815
1 changed files with 5 additions and 1 deletions

View File

@ -164,7 +164,11 @@ set(GENERIC_SOURCES
umodsi3.c
umodti3.c)
if(COMPILER_RT_HAS_ATOMIC_KEYWORD)
option(COMPILER_RT_EXCLUDE_ATOMIC_BUILTIN
"Skip the atomic builtin (this may be needed if system headers are unavailable)"
Off)
if(COMPILER_RT_HAS_ATOMIC_KEYWORD AND NOT COMPILER_RT_EXCLUDE_ATOMIC_BUILTIN)
set(GENERIC_SOURCES
${GENERIC_SOURCES}
atomic.c)