[LLVMdev] Fixing LLVM's CMake interface before LLVM3.5 release

Brad King brad.king at kitware.com
Fri Jul 18 06:38:49 PDT 2014


On 07/18/2014 08:51 AM, Dan Liew wrote:
> * run.sh is supposed to have executable permissions. Previously the
> ``configure_file`` command just copied the permissions on
> ``run.sh.in``. The ``file(GENERATE ...)`` command does not do this. Is
> there a way to fix this?

The file(GENERATE) command needs to be taught options to set permissions.
I've made a note for that.

For now can't you just run the script through a shell:

 /usr/bin/env bash /path/to/run.sh $args

?

> * The clang target is not being exported (I built clang in the usually
> way by placing its source inside /path/to/llvm/source/tools/clang)

Actually I don't think any Clang targets are exported yet.  That
may or may not belong as a separate find_package(Clang).  Not sure.

> Right now it seems much easier to use ``cmake_policy(SET CMP0026
> OLD)``. If I use this can I rely on the old behaviour being available
> forever?

One day the OLD behaviors may be removed.  Never set policies to OLD
except as warning fixups on existing release maintenance branches.

Since "clang" isn't exported you have to pick another target to
get the LOCATION from anyway, which is the same hack as you're
doing in the $<TARGET_FILE_DIR:opt>/clang example.

One could export a LLVM_TOOLS_DIR value from both the build and
install trees to resolve this case the old fashioned way.

> Also should we also expose whether or not LLVM was built with
> assertions? It's exposed as LLVM_BUILD_ENABLE_ASSERTIONS in the build
> directory but isn't available in the installed version of LLVM.

We already have a few LLVM_ENABLE_<SOMETHING> values exported.
One could add LLVM_ENABLE_ASSERTIONS.

Thanks,
-Brad




More information about the llvm-dev mailing list