diff options
author | David Tenty <daltenty@ibm.com> | 2019-06-07 15:45:25 +0000 |
---|---|---|
committer | David Tenty <daltenty@ibm.com> | 2019-06-07 15:45:25 +0000 |
commit | 4b1ba5168557dfcef8e3553fbc439846e37837df (patch) | |
tree | 3baf73560dc93d30025378f5258b647ef312ba8d /tools | |
parent | fe6f0b48d94e796528fb3352770363cc1c781e38 (diff) | |
download | clang-4b1ba5168557dfcef8e3553fbc439846e37837df.tar.gz |
Build with _XOPEN_SOURCE defined on AIX
Summary:
It is useful to build with _XOPEN_SOURCE defined on AIX, enabling X/Open
and POSIX compatibility mode, to work around stray macros and other
bugs in the headers provided by the system and build compiler.
This patch adds the config to cmake to build with _XOPEN_SOURCE defined
on AIX with a few exceptions. Google Test internals require access to
platform specific thread info constructs on AIX so in that case we build
with _ALL_SOURCE defined instead. Libclang also uses header which needs
_ALL_SOURCE on AIX so we leave that as is as well.
We also add building on AIX with the large file API and doing CMake
header checks with X/OPEN definitions so the results are consistent with
the environment that will be present in the build.
Reviewers: hubert.reinterpretcast, xingxue, andusy
Reviewed By: hubert.reinterpretcast
Subscribers: mgorny, jsji, cfe-commits, llvm-commits
Tags: #llvm, #clang
Differential Revision: https://reviews.llvm.org/D62533
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362808 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libclang/CMakeLists.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/libclang/CMakeLists.txt b/tools/libclang/CMakeLists.txt index 2de5b2956d..a2804ab17c 100644 --- a/tools/libclang/CMakeLists.txt +++ b/tools/libclang/CMakeLists.txt @@ -89,6 +89,11 @@ else() set(output_name "clang") endif() +# libclang requires headers which need _ALL_SOURCE to build on AIX +if (UNIX AND ${CMAKE_SYSTEM_NAME} MATCHES "AIX") + remove_definitions("-D_XOPEN_SOURCE=700") +endif() + add_clang_library(libclang ${ENABLE_SHARED} ${ENABLE_STATIC} OUTPUT_NAME ${output_name} ${SOURCES} |