Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 4,101
    • Issues 4,101
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMakeCMake
  • CMakeCMake
  • Issues
  • #18425
Closed
Open
Issue created Oct 05, 2018 by André Klitzing@miseryContributor

moc_predefs.h do not contain __ANDROID__ with clang (NDK) anymore (missing target)

We use cmake to generate moc_predefs.h for Qt5 and his moc binary.

Since we switched to clang compiler with Android NDK we see that it does not provide __ANDROID__ anymore.

$ /opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -dM -E -c /usr/share/cmake-3.12/Modules/CMakeCXXCompilerABI.cpp

[...]
$ /opt/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-g++ -dM -E -c /usr/share/cmake-3.12/Modules/CMakeCXXCompilerABI.cpp

[...]
#define __ANDROID__ 1

Looks like cmake misses to pass the target to the clang.

/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -dM -E -target aarch64-linux-android -c

https://github.com/android-ndk/ndk/issues/807

Edited Oct 05, 2018 by André Klitzing
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking