Skip to content

CMake build fails with LLVM in a subdirectory #3444

@llvmbot

Description

@llvmbot
Bugzilla Link 3072
Resolution FIXED
Resolved on Nov 16, 2008 11:50
Version unspecified
OS Linux
Reporter LLVM Bugzilla Contributor

Extended Description

Building LLVM with CMake fails if LLVM's top-level CMake file is not the top-level CMake file of the build.

To reproduce:

$ mkdir test
$ cd test
$ svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
$ echo "add_subdirectory(llvm)" >CMakeLists.txt
$ cd ..
$ mkdir test_build
$ cd test_build
$ cmake ../test
$ make

The error message:

[ 94%] Built target llvm-config.target
llvm/tools/opt/CMakeFiles/opt.dir/build.make:44: tools/opt/CMakeFiles/opt.dir/depend.make: No such file or directory
llvm/tools/opt/CMakeFiles/opt.dir/build.make:47: tools/opt/CMakeFiles/opt.dir/progress.make: No such file or directory
llvm/tools/opt/CMakeFiles/opt.dir/build.make:50: tools/opt/CMakeFiles/opt.dir/flags.make: No such file or directory
make[2]: *** No rule to make target `tools/opt/CMakeFiles/opt.dir/flags.make'. Stop.
make[1]: *** [llvm/tools/opt/CMakeFiles/opt.dir/all] Error 2
make: *** [all] Error 2

Note: I didn't use "svn co" but copied the directory from another SVN checkout. In theory this shouldn't make a difference. (The SVN revision I used was 59362)

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzilla

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions