Skip to content

Issues with 'HandleLLVMOptions' and 'LLVM_DEFINITIONS' #125779

@christopherbate

Description

@christopherbate

TLDR:

  • Some projects use the sequence find_project(LLVM) ; include(HandleLLVMOptions) to set directory-scoped cMake compilation options based on CMake variables provided by LLVMConfig.cmake. This includes compiler options, linker options, and compiler definitions.
  • HandleLLVMOptions will then also set LLVM_DEFINITIONS to the set of definitions in the top-level CMake scope.
  • Downstream projects are also invoking add_definitions(${LLVM_DEFINITIONS}) but they are unaware that a) LLVM_DEFINITIONS is a space-separated list and needs to be pre-processed and b) has different effects depending on ordering with HandleLLVMOptions and c) can cause duplication of compiler definitions

Metadata

Metadata

Assignees

No one assigned

    Labels

    cmakeBuild system in general and CMake in particularquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions