wolfpld / tracy

Frame profiler
https://tracy.nereid.pl/
Other
8.64k stars 595 forks source link

Add ZLib dependency into profiler #761

Open bollu opened 3 months ago

bollu commented 3 months ago

This fixes missing dependencies when compiling tracy-profiler with LEGACY=ON:

[100%] Linking CXX executable tracy-profiler
lto-wrapper: warning: using serial compilation of 6 LTRANS jobs

/usr/bin/ld: /usr/local/lib/libfreetype.a(ftgzip.c.o): in function `ft_gzip_file_fill_output':
/homes/sb2743/2024-borrowing/tracy/build/profiler/_deps/freetype-src/src/gzip/ftgzip.c:439: undefined reference to `inflate'
/usr/bin/ld: /usr/local/lib/libfreetype.a(ftgzip.c.o): in function `ft_gzip_file_reset':
/homes/sb2743/2024-borrowing/tracy/build/profiler/_deps/freetype-src/src/gzip/ftgzip.c:359: undefined reference to `inflateReset'
/usr/bin/ld: /usr/local/lib/libfreetype.a(ftgzip.c.o): in function `ft_gzip_file_done':
/homes/sb2743/2024-borrowing/tracy/build/profiler/_deps/freetype-src/src/gzip/ftgzip.c:330: undefined reference to `inflateEnd'
/usr/bin/ld: /usr/local/lib/libfreetype.a(ftgzip.c.o): in function `ft_gzip_file_init':
/homes/sb2743/2024-borrowing/tracy/build/profiler/_deps/freetype-src/src/gzip/ftgzip.c:315: undefined reference to `inflateInit2_'
/usr/bin/ld: /usr/local/lib/libfreetype.a(ftgzip.c.o): in function `ft_gzip_file_done':
/homes/sb2743/2024-borrowing/tracy/build/profiler/_deps/freetype-src/src/gzip/ftgzip.c:330: undefined reference to `inflateEnd'
/usr/bin/ld: /usr/local/lib/libfreetype.a(ftgzip.c.o): in function `FT_Gzip_Uncompress':
/homes/sb2743/2024-borrowing/tracy/build/profiler/_deps/freetype-src/src/gzip/ftgzip.c:749: undefined reference to `inflateInit2_'
/usr/bin/ld: /homes/sb2743/2024-borrowing/tracy/build/profiler/_deps/freetype-src/src/gzip/ftgzip.c:753: undefined reference to `inflate'
/usr/bin/ld: /homes/sb2743/2024-borrowing/tracy/build/profiler/_deps/freetype-src/src/gzip/ftgzip.c:756: undefined reference to `inflateEnd'
/usr/bin/ld: /homes/sb2743/2024-borrowing/tracy/build/profiler/_deps/freetype-src/src/gzip/ftgzip.c:764: undefined reference to `inflateEnd'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/tracy-profiler.dir/build.make:1165: tracy-profiler] Error 1
make[1]: *** [CMakeFiles/Makefile2:280: CMakeFiles/tracy-profiler.dir/all] Error 2
wolfpld commented 3 months ago

Zlib is a freetype dependency. Adding it to the profiler is incorrect.

% ldd /usr/lib/libfreetype.so | grep libz
        libz.so.1 => /usr/lib/libz.so.1 (0x00007a5840220000)
bollu commented 3 months ago

Then I am somewhat unsure as to why this fixes a link issue I have.

wolfpld commented 3 months ago

You are trying to link in a static library (libfreetype.a). Static libraries do not carry link dependencies. What is your reason for not using a shared library?

Anyways, this is a problem with your system configuration. Try enabling the DOWNLOAD_FREETYPE CMake option to circumvent.