libcheck / check

A unit testing framework for C
GNU Lesser General Public License v2.1
1.07k stars 209 forks source link

Wrong binaries on Windows #340

Open Thomas1664 opened 2 years ago

Thomas1664 commented 2 years ago

On Windows I get the following binaries after Build:

/bin/manual-link/checkDynamic.dll
/bin/manual-link/checkDynamic.pdb
/debug/bin/checkDynamic.dll
/debug/bin/checkDynamic.pdb
/debug/lib/check.lib
/debug/lib/checkDynamic.lib
/debug/lib/manual-link/compat.lib
/lib/check.lib
/lib/checkDynamic.lib
/lib/compat.lib

2 Questions: What is compat.lib for?

Why checkDynamic.lib? This is installed even if I'm only building a static library. The way I understand this it is only used for linking into the DLL. In this case, this is most likely wrong.

agrandville commented 2 years ago

Hi @Thomas1664, third party lib compat is no more necessary https://github.com/libcheck/check/commit/02783adccdf2879cb788c301066336918794267c When I build this project,

D:\dev\check\tmp32>cmake .. -G "Visual Studio 16 2019" -A Win32 -DCMAKE_INSTALL_PREFIX="D:/dev/check/out32.dbg"
..lot of output...
D:\dev\check\tmp32>cmake --build . --target install
..lot of output...

I get this files. imho there is no flag to disable the dynamic library build

D:\dev\check\out32.dbg
+---bin
|       checkDynamic.dll
|       checkmk
|
+---include
|       check.h
|       check_stdint.h
|
+---lib
|   |   check.lib
|   |   checkDynamic.lib
|   |
|   +---cmake
|   |   \---check
|   |           check-config-version.cmake
|   |           check-config.cmake
|   |           check-targets-debug.cmake
|   |           check-targets.cmake
|   |
|   \---pkgconfig
|           check.pc
|
\---share
    \---man
        +---man1
        |       checkmk.1
        |
        +---man3
        |       suite_create.3
        |
        \---man7
                libcheck.7
Thomas1664 commented 1 year ago

Hi @agrandville,

first of all, sorry for the late response.

imho there is no flag to disable the dynamic library build

You can set BUILD_SHARED_LIBS to OFF. See the CMake documentation. This requires to remove STATIC and SHARED from calls to add_library.

Hi @Thomas1664, third party lib compat is no more necessary 02783ad

This is a general question: What is libcompat and where to get its sources from?