ngtcp2 / nghttp3

HTTP/3 library written in C
https://nghttp2.org/nghttp3/
MIT License
828 stars 88 forks source link

static lib built even if -DENABLE_STATIC_LIB=OFF is passed to cmake #227

Closed vtorri closed 2 days ago

vtorri commented 1 month ago

On Windows 10, using msys2 + mingw-w64 :

cmake \
    -DCMAKE_TOOLCHAIN_FILE=../cross_toolchain.txt \
    -DCMAKE_INSTALL_PREFIX=$prefix_unix \
    -DCMAKE_VERBOSE_MAKEFILE:BOOL=$verbcmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DENABLE_SHARED_LIBS=ON \
    -DENABLE_STATIC_LIB=OFF \
    -DENABLE_DEBUG=OFF \
    -DENABLE_LIB_ONLY=ON \
    -DBUILD_TESTING=OFF \
    -G "Unix Makefiles" \
    ..

make -j $jobopt install

cmake output:

    Library:
      Shared:         ON
      Static:         ON

make output:

-- Installing: C:/Documents/msys2/home/vincent.torri/ewpi_64/lib/libnghttp3.dll.a
-- Installing: C:/Documents/msys2/home/vincent.torri/ewpi_64/bin/libnghttp3.dll
-- Installing: C:/Documents/msys2/home/vincent.torri/ewpi_64/lib/libnghttp3.a
-- Installing: C:/Documents/msys2/home/vincent.torri/ewpi_64/lib/pkgconfig/libnghttp3.pc
vszakats commented 1 month ago

Which nghttp3 version did you use? I could not replicate it with latest master or 1.3.0:

$ cmake . -B _bld -DBUILD_TESTING=OFF -DENABLE_LIB_ONLY=ON \
  -DENABLE_SHARED_LIB=ON -DENABLE_STATIC_LIB=OFF \
  -DCMAKE_SYSTEM_NAME=Windows \
  -DCMAKE_C_COMPILER_TARGET=x86_64-w64-mingw32 \
  -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
[...]
-- summary of build options:

    Package version: 1.3.0
[...]
      WARNCXXFLAGS:     -Wall -Wformat-security -Wno-noexcept-type
    Library:
      Shared:         ON
      Static:         OFF
    Test:
      Build Test:     OFF
    Library only:     ON
    Examples:         0
github-actions[bot] commented 1 week ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.