diasurgical / devilutionX

Diablo build for modern operating systems
Other
8.1k stars 796 forks source link

Unable to compile on macOS 10.14.6 #996

Closed eisnerguy1 closed 3 years ago

eisnerguy1 commented 3 years ago

I'm trying to compile on macOS 10.14.6 and I'm running into an issue:

eisnerguy1s-MacBook-Pro-7:devilutionX-master eisnerguy1$ brew bundle install
Updating Homebrew...
==> Auto-updated Homebrew!
Updated Homebrew from 42b755e13 to 0d1aa33f8.
Updated 3 taps (phinze/cask, homebrew/core and homebrew/cask).
==> New Formulae
dasel
==> Updated Formulae
Updated 68 formulae.
==> New Casks
gather                                   gather
==> Updated Casks
Updated 54 casks.

==> Homebrew was updated to version 3.0.0
More detailed release notes are available on the Homebrew Blog:
  https://brew.sh/blog/3.0.0
Using cmake
Using sdl2_mixer
Using sdl2_ttf
Using libsodium
Using pkg-config
Homebrew Bundle complete! 5 Brewfile dependencies now installed.
eisnerguy1s-MacBook-Pro-7:devilutionX-master eisnerguy1$ cd build
eisnerguy1s-MacBook-Pro-7:build eisnerguy1$ cmake ..
fatal: No names found, cannot describe anything.
CMake Warning at CMakeLists.txt:53 (project):
  VERSION keyword not followed by a value or was followed by a value that
  expanded to nothing.

-- The C compiler identification is AppleClang 10.0.1.10010046
-- The CXX compiler identification is AppleClang 10.0.1.10010046
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found SDL2_ttf: /Library/Frameworks/SDL2_ttf.framework  
-- Found SDL2: /Users/eisnerguy1/Library/Frameworks/SDL2.framework  
-- Found SDL2_mixer: /Library/Frameworks/SDL2_mixer.framework  
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/eisnerguy1/Applications/Blizzard/Diablo/devilutionX/Hellfire/source/devilutionX-master/build
eisnerguy1s-MacBook-Pro-7:build eisnerguy1$ cmake --build . -j $(sysctl -n hw.physicalcpu)
Scanning dependencies of target Radon
Scanning dependencies of target StormLib
Scanning dependencies of target PKWare
Scanning dependencies of target SourceS
[  0%] Building CXX object CMakeFiles/PKWare.dir/3rdParty/PKWare/explode.cpp.o
[  0%] Building CXX object CMakeFiles/Radon.dir/3rdParty/Radon/Radon/source/File.cpp.o
[  0%] Building CXX object CMakeFiles/StormLib.dir/3rdParty/StormLib/src/FileStream.cpp.o
[  1%] Building CXX object CMakeFiles/SourceS.dir/SourceS/paths.cpp.o
[  2%] Building CXX object CMakeFiles/PKWare.dir/3rdParty/PKWare/implode.cpp.o
[  3%] Building CXX object CMakeFiles/StormLib.dir/3rdParty/StormLib/src/SBaseCommon.cpp.o
[  4%] Linking CXX static library libPKWare.a
[  4%] Built target PKWare
Scanning dependencies of target smacker
[  4%] Building C object CMakeFiles/smacker.dir/3rdParty/libsmacker/smk_bitstream.c.o
[  5%] Building CXX object CMakeFiles/StormLib.dir/3rdParty/StormLib/src/SBaseFileTable.cpp.o
[  6%] Linking CXX static library libSourceS.a
[  7%] Building C object CMakeFiles/smacker.dir/3rdParty/libsmacker/smk_hufftree.c.o
[  7%] Built target SourceS
[  7%] Building CXX object CMakeFiles/StormLib.dir/3rdParty/StormLib/src/SBaseSubTypes.cpp.o
[  8%] Building CXX object CMakeFiles/Radon.dir/3rdParty/Radon/Radon/source/Key.cpp.o
[  9%] Building C object CMakeFiles/smacker.dir/3rdParty/libsmacker/smacker.c.o
[ 10%] Building CXX object CMakeFiles/StormLib.dir/3rdParty/StormLib/src/SCompression.cpp.o
Scanning dependencies of target devilution
[ 11%] Linking C static library libsmacker.a
[ 11%] Built target smacker
[ 12%] Building CXX object CMakeFiles/Radon.dir/3rdParty/Radon/Radon/source/Named.cpp.o
[ 13%] Building CXX object CMakeFiles/StormLib.dir/3rdParty/StormLib/src/SFileExtractFile.cpp.o
[ 13%] Building CXX object CMakeFiles/Radon.dir/3rdParty/Radon/Radon/source/Section.cpp.o
[ 14%] Building CXX object CMakeFiles/StormLib.dir/3rdParty/StormLib/src/SFileFindFile.cpp.o
[ 15%] Building CXX object CMakeFiles/devilution.dir/Source/appfat.cpp.o
[ 15%] Building CXX object CMakeFiles/StormLib.dir/3rdParty/StormLib/src/SFileGetFileInfo.cpp.o
[ 16%] Building CXX object CMakeFiles/StormLib.dir/3rdParty/StormLib/src/SFileOpenArchive.cpp.o
[ 17%] Building CXX object CMakeFiles/devilution.dir/Source/automap.cpp.o
[ 18%] Linking CXX static library libRadon.a
[ 18%] Built target Radon
[ 18%] Building CXX object CMakeFiles/devilution.dir/Source/capture.cpp.o
[ 19%] Building CXX object CMakeFiles/devilution.dir/Source/codec.cpp.o
[ 20%] Building CXX object CMakeFiles/devilution.dir/Source/control.cpp.o
[ 21%] Building CXX object CMakeFiles/StormLib.dir/3rdParty/StormLib/src/SFileOpenFileEx.cpp.o
[ 21%] Building CXX object CMakeFiles/StormLib.dir/3rdParty/StormLib/src/SFileReadFile.cpp.o
[ 21%] Building CXX object CMakeFiles/devilution.dir/Source/cursor.cpp.o
[ 22%] Linking CXX static library libStormLib.a
[ 23%] Building CXX object CMakeFiles/devilution.dir/Source/dead.cpp.o
[ 23%] Built target StormLib
[ 24%] Building CXX object CMakeFiles/devilution.dir/Source/debug.cpp.o
[ 24%] Building CXX object CMakeFiles/devilution.dir/Source/diablo.cpp.o
[ 25%] Building CXX object CMakeFiles/devilution.dir/Source/doom.cpp.o
[ 26%] Building CXX object CMakeFiles/devilution.dir/Source/drlg_l1.cpp.o
[ 27%] Building CXX object CMakeFiles/devilution.dir/Source/drlg_l2.cpp.o
[ 27%] Building CXX object CMakeFiles/devilution.dir/Source/drlg_l3.cpp.o
[ 28%] Building CXX object CMakeFiles/devilution.dir/Source/drlg_l4.cpp.o
[ 29%] Building CXX object CMakeFiles/devilution.dir/Source/dthread.cpp.o
[ 29%] Building CXX object CMakeFiles/devilution.dir/Source/effects.cpp.o
[ 30%] Building CXX object CMakeFiles/devilution.dir/Source/encrypt.cpp.o
[ 31%] Building CXX object CMakeFiles/devilution.dir/Source/engine.cpp.o
[ 32%] Building CXX object CMakeFiles/devilution.dir/Source/error.cpp.o
[ 32%] Building CXX object CMakeFiles/devilution.dir/Source/gamemenu.cpp.o
[ 33%] Building CXX object CMakeFiles/devilution.dir/Source/gendung.cpp.o
[ 34%] Building CXX object CMakeFiles/devilution.dir/Source/gmenu.cpp.o
[ 34%] Building CXX object CMakeFiles/devilution.dir/Source/help.cpp.o
[ 35%] Building CXX object CMakeFiles/devilution.dir/Source/init.cpp.o
[ 36%] Building CXX object CMakeFiles/devilution.dir/Source/interfac.cpp.o
[ 37%] Building CXX object CMakeFiles/devilution.dir/Source/inv.cpp.o
[ 37%] Building CXX object CMakeFiles/devilution.dir/Source/itemdat.cpp.o
[ 38%] Building CXX object CMakeFiles/devilution.dir/Source/items.cpp.o
[ 39%] Building CXX object CMakeFiles/devilution.dir/Source/lighting.cpp.o
[ 39%] Building CXX object CMakeFiles/devilution.dir/Source/loadsave.cpp.o
[ 40%] Building CXX object CMakeFiles/devilution.dir/Source/mainmenu.cpp.o
[ 41%] Building CXX object CMakeFiles/devilution.dir/Source/minitext.cpp.o
[ 42%] Building CXX object CMakeFiles/devilution.dir/Source/misdat.cpp.o
[ 42%] Building CXX object CMakeFiles/devilution.dir/Source/missiles.cpp.o
[ 43%] Building CXX object CMakeFiles/devilution.dir/Source/monstdat.cpp.o
[ 44%] Building CXX object CMakeFiles/devilution.dir/Source/monster.cpp.o
[ 44%] Building CXX object CMakeFiles/devilution.dir/Source/movie.cpp.o
[ 45%] Building CXX object CMakeFiles/devilution.dir/Source/mpqapi.cpp.o
[ 46%] Building CXX object CMakeFiles/devilution.dir/Source/msg.cpp.o
[ 46%] Building CXX object CMakeFiles/devilution.dir/Source/multi.cpp.o
[ 47%] Building CXX object CMakeFiles/devilution.dir/Source/nthread.cpp.o
[ 48%] Building CXX object CMakeFiles/devilution.dir/Source/objdat.cpp.o
[ 49%] Building CXX object CMakeFiles/devilution.dir/Source/objects.cpp.o
[ 49%] Building CXX object CMakeFiles/devilution.dir/Source/pack.cpp.o
[ 50%] Building CXX object CMakeFiles/devilution.dir/Source/palette.cpp.o
[ 51%] Building CXX object CMakeFiles/devilution.dir/Source/path.cpp.o
[ 51%] Building CXX object CMakeFiles/devilution.dir/Source/pfile.cpp.o
[ 52%] Building CXX object CMakeFiles/devilution.dir/Source/player.cpp.o
[ 53%] Building CXX object CMakeFiles/devilution.dir/Source/plrmsg.cpp.o
[ 54%] Building CXX object CMakeFiles/devilution.dir/Source/portal.cpp.o
[ 54%] Building CXX object CMakeFiles/devilution.dir/Source/quests.cpp.o
[ 55%] Building CXX object CMakeFiles/devilution.dir/Source/render.cpp.o
[ 56%] Building CXX object CMakeFiles/devilution.dir/Source/restrict.cpp.o
[ 56%] Building CXX object CMakeFiles/devilution.dir/Source/scrollrt.cpp.o
[ 57%] Building CXX object CMakeFiles/devilution.dir/Source/setmaps.cpp.o
[ 58%] Building CXX object CMakeFiles/devilution.dir/Source/sha.cpp.o
[ 59%] Building CXX object CMakeFiles/devilution.dir/Source/spelldat.cpp.o
[ 59%] Building CXX object CMakeFiles/devilution.dir/Source/spells.cpp.o
[ 60%] Building CXX object CMakeFiles/devilution.dir/Source/stores.cpp.o
[ 61%] Building CXX object CMakeFiles/devilution.dir/Source/sync.cpp.o
[ 61%] Building CXX object CMakeFiles/devilution.dir/Source/textdat.cpp.o
[ 62%] Building CXX object CMakeFiles/devilution.dir/Source/themes.cpp.o
[ 63%] Building CXX object CMakeFiles/devilution.dir/Source/tmsg.cpp.o
[ 63%] Building CXX object CMakeFiles/devilution.dir/Source/town.cpp.o
[ 64%] Building CXX object CMakeFiles/devilution.dir/Source/towners.cpp.o
[ 65%] Building CXX object CMakeFiles/devilution.dir/Source/track.cpp.o
[ 66%] Building CXX object CMakeFiles/devilution.dir/Source/trigs.cpp.o
[ 66%] Linking CXX static library libdevilution.a
[ 66%] Built target devilution
Scanning dependencies of target devilutionx
[ 67%] Building CXX object CMakeFiles/devilutionx.dir/SourceX/controls/devices/joystick.cpp.o
[ 68%] Building CXX object CMakeFiles/devilutionx.dir/SourceX/dx.cpp.o
[ 69%] Building CXX object CMakeFiles/devilutionx.dir/SourceX/controls/devices/kbcontroller.cpp.o
[ 69%] Building CXX object CMakeFiles/devilutionx.dir/SourceX/controls/devices/game_controller.cpp.o
[ 70%] Building CXX object CMakeFiles/devilutionx.dir/SourceX/controls/controller.cpp.o
[ 71%] Building CXX object CMakeFiles/devilutionx.dir/SourceX/controls/controller_motion.cpp.o
[ 71%] Building CXX object CMakeFiles/devilutionx.dir/SourceX/controls/game_controls.cpp.o
[ 72%] Building CXX object CMakeFiles/devilutionx.dir/SourceX/controls/menu_controls.cpp.o
[ 73%] Building CXX object CMakeFiles/devilutionx.dir/SourceX/controls/modifier_hints.cpp.o
[ 73%] Building CXX object CMakeFiles/devilutionx.dir/SourceX/controls/plrctrls.cpp.o
[ 74%] Building CXX object CMakeFiles/devilutionx.dir/SourceX/controls/touch.cpp.o
[ 75%] Building CXX object CMakeFiles/devilutionx.dir/SourceX/display.cpp.o
[ 76%] Building CXX object CMakeFiles/devilutionx.dir/SourceX/miniwin/misc_msg.cpp.o
[ 76%] Building CXX object CMakeFiles/devilutionx.dir/SourceX/thread.cpp.o
[ 77%] Building CXX object CMakeFiles/devilutionx.dir/SourceX/sound.cpp.o
/Users/eisnerguy1/Applications/Blizzard/Diablo/devilutionX/Hellfire/source/devilutionX-master/SourceX/display.cpp:224:32: error: use of undeclared identifier 'SDL_RenderSetIntegerScale'
                if (integerScalingEnabled && SDL_RenderSetIntegerScale(renderer, SDL_TRUE) < 0) {
                                             ^
1 error generated.
gmake[2]: *** [CMakeFiles/devilutionx.dir/build.make:233: CMakeFiles/devilutionx.dir/SourceX/display.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:220: CMakeFiles/devilutionx.dir/all] Error 2
gmake: *** [Makefile:171: all] Error 2
eisnerguy1s-MacBook-Pro-7:build eisnerguy1$

The only changes I made to CMakeLists.txt were:

option(NONET "Disable network" ON)
option(HELLFIRE "Build hellfire version" ON)

Am I missing something super obvious?

AJenbo commented 3 years ago

This function is available since SDL 2.0.5. could you check what was installed?

eisnerguy1 commented 3 years ago

This function is available since SDL 2.0.5. could you check what was installed?

I've got sdl2 2.0.14_1, sdl2_mixer 2.0.4 & sdl2_ttf 2.0.15. The were installed with Homebrew if that makes any difference.

alexey-lysiuk commented 3 years ago
-- Found SDL2_ttf: /Library/Frameworks/SDL2_ttf.framework  
-- Found SDL2: /Users/eisnerguy1/Library/Frameworks/SDL2.framework  
-- Found SDL2_mixer: /Library/Frameworks/SDL2_mixer.framework  

Most likely, old versions of SDL2 frameworks were picked by CMake. Usually, Homebrew doesn't install anything to ~/Library nor to /Library/Frameworks directories.

eisnerguy1 commented 3 years ago

Yep, that was the issue. I copied the the current versions of the .framework files to the appropriate locations and everything builds without errors

Screen Shot 2021-02-06 at 4 25 30 AM

I did try building the source with Hellfire not enabled in CMakeLists.txt and it still launched Hellfire despite not being built to enable it. I've got Diabdat.mpq, hellfire.mpq, hfmonk.mpq, hfmusic.mpq & hfvoice.mpq in /Users/eisnerguy1/Library/Application Support/diasurgical/devilution/.

If I make sure that just Diabdat.mpq and the non-Hellfire app are in the same folder, everything works as expected. But, when the non-Hellfire app is either in the same directory of the Hellfire mpg files, or the Hellfire mpq files are in the directory listed above, alongside Diabdat.mpq, Hellfire still launches.

AJenbo commented 3 years ago

Yeah, we are working on unifying the binaries. As you have noticed it will detect the game based on the available mpq files, but also you can force it to ignore hellfire with --diablo. Currently there are still 3 minor parts of hellfire not unified so that is why it still appears as a CMake option.