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

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Jun 27 23:44:43 BST 2021


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256783

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.
You are the assignee for the bug.


More information about the kde-freebsd mailing list