[Bug 256783] Mk/Uses/cmake.mk: Some cmake ports builds twice

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 27 Jun 2021 22:44:43 +0000

Adriaan de Groot <adridg_at_freebsd.org> changed:

           What    |Removed                     |Added
                 CC|                            |adridg_at_freebsd.org
             Status|Open                        |In Progress

--- Comment #2 from Adriaan de Groot <adridg_at_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_at_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_at_beastie /tmp]$ cat main.c
extern int x;
int main(int argc, char** argv)
return x * argc;
[adridg_at_beastie /tmp]$ cat tu.c
int x = 0;
[adridg_at_beastie /tmp]$ cat tv.c
int x = 1;

With `make`, the objects are built, and the executables linked:
[adridg_at_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_at_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.
Received on Sun Jun 27 2021 - 22:44:43 UTC

Original text of this message