Skip to content
  • Stephen Kelly's avatar
    automoc: Add source file to target early to set the linker language · 79568f95
    Stephen Kelly authored and Brad King's avatar Brad King committed
    Previously, GetIncludeDirectories was called before calling
    target->AddSourceFile(mocCppSource). Since commit a1c4905f (Use the
    link information as a source of compile definitions and
    includes., 2013-02-12), the include directories are determined by
    the link information.
    
    Valid link information requires that the linker language can be
    determined, which depends on the source files languages and the
    dependent targets languages. In the case of the no_link_languages
    target in the unit test, there are no dependencies and the additional
    source file no_link_languages_automoc.cpp is added to the target
    at generate-time. That file can be used to determine the linker
    language, but it must be added to the target before calling
    GetIncludeDirectories.
    79568f95