Is it possible to update cmake build without running cmake again? (Noob clang warning)

Clang/LLVM

I am using Clang now for some time successfully with some of our internal projects.
I always use cmake as the makefile generator (build system).
I always use clang to build clang … :slight_smile: … before I install it I do the “make clang-test” obviously …

The command I run is as follows:
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_ENABLE_ASSERTIONS=OFF -DLLVM_BUILD_TESTS=ON -DLLVM_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release -DREQUIRES_RTTI=1 -G “Unix Makefiles” …

It is currently working very nice, but for one small little annoying problem, this is most likely a noob problem:
I see when you do a “.configure” you can actually do a “make update” … and then only the changes gets compiled and iterated through.
But when I do the SVN update on my source, cmake complains that I have changed some variables (even if I used the same instruction) and then when I run “make -j4” in the build directory it starts to compile from scratch everything (my argument is that if you guys added files, cmake needs to be informed of the new files … right?) … not a “train-smash” though … at the pace that clang/llvm is moving I would like to have the latest without source builds, and if possible only build and link the changes into the already compiled objects …

PS. Clang totally rocks … here is hoping that emacs and vim aren’t the the two only editors that will be using its “other” features …

Best regards,

Dawie

Dawie Joubert <joubertdj@gmail.com>
writes:

[snip]

The command I run is as follows:
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
-DLLVM_ENABLE_ASSERTIONS=OFF -DLLVM_BUILD_TESTS=ON
-DLLVM_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release -DREQUIRES_RTTI=1 -G
"Unix Makefiles" ..

-DREQUIRES_RTTI=1 works by chance. It is not intented to be used as a
configuration option. Why do you need it? What breaks if you omit it?

[snip]

But when I do the SVN update on my source, cmake complains that I have
changed some variables (even if I used the same instruction) and then
when I run "make -j4" in the build directory it starts to compile from
scratch everything (my argument is that if you guys added files, cmake
needs to be informed of the new files ... right?)

Any modification to the cmake stuff (all those CMakeLists.txt, the
configured headers suchs as config.h.cmake and the files under cmake/)
will trigger a reconfiguration.

... not a "train-smash" though ... at the pace that clang/llvm is
moving I would like to have the latest without source builds, and if
possible only build and link the changes into the already compiled
objects ...

This is how it should work and it is how it works for me. Please note
that changes on global header files happen often and LLVM/clang has a
very intrincate dependency graph, so it is quite common that an update
causes a large rebuild.

Just as a far-fetched possibility, check on the CMakeCache.txt file from
your build directory that LLVM_APPEND_VC_REV is set to OFF. Otherwise
every svn update that causes a reconfiguration will require a rebuild.

[snip]

Oscar,

Thanks for the info, but I believe I have found the correct answer.
According to CMake in http://www.cmake.org/Wiki/CMake_Useful_Variables, they indicated that should only set the compiler type once (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++), the subsequent calls to cmake should not have those strings in as Cmake will delete your whole cache and compile everything from scratch … thus if you want to compile Clang with Clang … :slight_smile: … then you only configure it once with the different compiler settings … the subsequent calls should exclude those settings as it handles the Cmake cache as a reference versus the “changes” that SVN did … now my builds are far faster … and I can enjoy the luxury of having a bleeding edge Clang …

Best regards Clang-devs …

Enjoy …

Dawie

According to cmake

Dawie Joubert <joubertdj@gmail.com>
writes:

Thanks for the info, but I believe I have found the correct answer.
According to CMake in http://www.cmake.org/Wiki/CMake_Useful_Variables,
they indicated that should only set the compiler type once
(-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++), the subsequent
calls to cmake should not have those strings in as Cmake will delete
your whole cache and compile everything from scratch ... thus if you
want to compile Clang with Clang ... :slight_smile: ... then you only configure it
once with the different compiler settings ... the subsequent calls
should exclude those settings as it handles the Cmake cache as a
reference versus the "changes" that SVN did ... now my builds are far
faster ... and I can enjoy the luxury of having a bleeding edge
Clang ...

Of course you should invoke cmake just once for configuring the build
and use `make' thereafter, unless you want to change any configuration
paramenter. If the documentation contains something that could be
interpreted as saying that cmake must be explicitly invoked before
running every build, please tell us and we will try to fix the wording.