[Bug 256783] Mk/Uses/cmake.mk: Some cmake ports builds twice
- In reply to: bugzilla-noreply_a_freebsd.org: "[Bug 256783] Some cmake ports builds twice"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 27 Jun 2021 22:44:43 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256783 Adriaan de Groot <adridg@freebsd.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |adridg@freebsd.org Status|Open |In Progress --- Comment #2 from Adriaan de Groot <adridg@freebsd.org> --- To some extent this is expected: CMake (re-)links executables while installing. You can see that with these four files (CMakeLists.txt, main.c, tu.c, tv.c): ``` [adridg@beastie /tmp]$ cat CMakeLists.txt cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(derp LANGUAGES C) add_executable(derp1 tu.c main.c) add_executable(derp2 tv.c main.c) install(TARGETS derp1 derp2 DESTINATION /tmp) [adridg@beastie /tmp]$ cat main.c extern int x; int main(int argc, char** argv) { return x * argc; } [adridg@beastie /tmp]$ cat tu.c int x = 0; [adridg@beastie /tmp]$ cat tv.c int x = 1; ``` With `make`, the objects are built, and the executables linked: ``` [adridg@beastie /tmp]$ make [ 16%] Building C object CMakeFiles/derp1.dir/tu.c.o [ 33%] Building C object CMakeFiles/derp1.dir/main.c.o [ 50%] Linking C executable derp1 [ 50%] Built target derp1 [ 66%] Building C object CMakeFiles/derp2.dir/tv.c.o [ 83%] Building C object CMakeFiles/derp2.dir/main.c.o [100%] Linking C executable derp2 [100%] Built target derp2 ``` And then `make install` (which is what staging does) does some re-compilation and re-linking: ``` [adridg@beastie /tmp]$ make install Consolidate compiler generated dependencies of target derp1 [ 50%] Built target derp1 Consolidate compiler generated dependencies of target derp2 [100%] Built target derp2 Install the project... -- Install configuration: "" ``` I built comms/svxlink and devel/cpp-hocon in poudriere just now, and while there is the expected consolidation / re-linking, I don't see the kind of rebuild you show in your log. I suspect time drift, frankly. -- You are receiving this mail because: You are on the CC list for the bug.