Josko / aura-bot

Warcraft III high-performance hosting bot written in C++14.
76 stars 42 forks source link

[unsupportd platforms] [msys2] can't build stormlib - bzip2 includes not found #58

Closed Cokemonkey11 closed 6 years ago

Cokemonkey11 commented 6 years ago

When building stormlib:

$ cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_DYNAMIC_MODULE=1 ..
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
CMake Warning at /usr/share/cmake-3.6.2/Modules/Platform/MSYS.cmake:15 (message):
  CMake no longer defines WIN32 on MSYS!

  (1) If you are just trying to build this project, ignore this warning or
  quiet it by setting CMAKE_LEGACY_CYGWIN_WIN32=0 in your environment or in
  the CMake cache.  If later configuration or build errors occur then this
  project may have been written under the assumption that MSYS is WIN32.  In
  that case, set CMAKE_LEGACY_CYGWIN_WIN32=1 instead.

  (2) If you are developing this project, add the line

    set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required

  at the top of your top-level CMakeLists.txt file or set the minimum
  required version of CMake to 2.8.4 or higher.  Then teach your project to
  build on Cygwin without WIN32.
Call Stack (most recent call first):
  /usr/share/cmake-3.6.2/Modules/CMakeSystemSpecificInformation.cmake:37 (include)
  CMakeLists.txt:1 (project)

-- Check for working C compiler: /usr/bin/cc.exe
-- Check for working C compiler: /usr/bin/cc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++.exe
-- Check for working CXX compiler: /usr/bin/c++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /usr/lib/libz.dll.a (found version "1.2.11")
CMake Error at /usr/share/cmake-3.6.2/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find BZip2 (missing: BZIP2_LIBRARIES BZIP2_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.6.2/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.6.2/Modules/FindBZip2.cmake:54 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:281 (find_package)

-- Configuring incomplete, errors occurred!

But, bzip2 is installed:

$ pacman -Ss bzip2
mingw32/mingw-w64-i686-bzip2 1.0.6-6 [installed]
    A high-quality data compression program (mingw-w64)
mingw64/mingw-w64-x86_64-bzip2 1.0.6-6 [installed]
    A high-quality data compression program (mingw-w64)
msys/bzip2 1.0.6-2 (base compression) [installed]
    A high-quality data compression program
msys/perl 5.24.1-2 (base-devel) [installed]
    A highly capable, feature-rich programming language
msys/perl-Compress-Bzip2 2.22-1 (perl-modules)
    Interface to Bzip2 compression library

Expected behavior: cmake finds bzip2 on msys2.

Josko commented 6 years ago

Sadly, this is an upstream problem. I don't think the support for it would be too time intensive (or just straight up hack it in in the CMakeLists.txt) but for me it's already hard enough to maintain the VS compat on Windows as I'm exclusively a "GNU plus Linux" user. Perhaps try to open a ticket there...