How can I make clang's td file be aware of cmake variables?

Earlier this afternoon, I posted a question regarding building clang 3.4 standalone, which I soon came up a quick and dirty get-around. Now I would like fix it properly. I started studying cmake twp weeks ago but I am comfortable in reading/editing/creating listfiles. No, I am not a compiler person, but I am an engineer (but not a software developer) and I read/write code :slight_smile:

I would like to know for clang 3.4, How can I make set cmake variables such as

  1. LLVM_MAIN_SRC_DIR

  2. CLANG_PATH_TO_LLVM_BUILD

be utilized by some td files such as the following two?

  • ${CMAKE_SOURCE_DIRECTORY}/include/clang/Driver/Options.td

  • ${CMAKE_SOURCE_DIRECTORY}/include/clang/Driver/CC1AsOptions.td

They both have a include statement:

// Include the common option parsing interfaces.

include “llvm/Option/OptParser.td”

which regardless which cmake variable that I set, they took no effect. So far, I have been putting in the full path into said include statement, but this obviously is not ideal. Can anyone give me a hint as to how to make these td files cmake variable aware?

– Zack

I did some more digging, and ran into this LLVM online doc. But it says nullptr as to how to make it cmake variable aware x-(

– Zack