Skip to content

Build guide needs to be improved. #22

@anikom15

Description

@anikom15

I attempted to build the latest code on Windows by following the build guide. This did not work. It wasn't exactly clear what commands I needed to use to get cmake to work. This is what I tried:

$ cmake -B build -S src -D CMAKE_TOOLCHAIN_FILE=./cmake/flags-gcc-x86_64.cmake --preset regular
CMake Error: Could not read presets from C:/msys64/home/Westley/86Box/src: File not found

I then tried this:

$ cmake --preset regular -D CMAKE_TOOLCHAIN_FILE=./cmake/flags-gcc-x86_64.cmake
Preset CMake variables:

  CMAKE_BUILD_TYPE="Release"
  CMAKE_EXPORT_COMPILE_COMMANDS:BOOL="TRUE"
  CMAKE_INSTALL_PREFIX="C:/msys64/home/Westley/86Box/build/artifacts"
  DEV_BRANCH="OFF"
  NEW_DYNAREC="OFF"
  QT="ON"

-- The C compiler identification is GNU 13.1.0
-- The CXX compiler identification is GNU 13.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/ucrt64/bin/cc.exe - 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: C:/msys64/ucrt64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Freetype: C:/msys64/ucrt64/lib/libfreetype.a (found version "2.13.0")
-- Found ZLIB: C:/msys64/ucrt64/lib/libz.a (found version "1.2.13")
-- Found PNG: C:/msys64/ucrt64/lib/libpng.a (found version "1.6.39")
-- Found OpenAL: C:/msys64/ucrt64/lib/libopenal.a
-- Found PkgConfig: C:/msys64/ucrt64/bin/pkg-config.exe (found version "1.8.0")
-- Checking for module 'rtmidi'
--   Found rtmidi, version 5.0.0
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Configuring done (3.7s)
-- Generating done (0.2s)
-- Build files have been written to: C:/msys64/home/Westley/86Box/build/regular

That seemed to work okay. I then did this:

$ cmake -B build -S src
-- Building for: Ninja
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 13.1.0
-- The CXX compiler identification is GNU 13.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/ucrt64/bin/cc.exe - 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: C:/msys64/ucrt64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Freetype: C:/msys64/ucrt64/lib/libfreetype.dll.a (found version "2.13.0")
-- Found ZLIB: C:/msys64/ucrt64/lib/libz.dll.a (found version "1.2.13")
-- Found PNG: C:/msys64/ucrt64/lib/libpng.dll.a (found version "1.6.39")
CMake Error at cpu/CMakeLists.txt:37 (target_link_libraries):
  Attempt to add link library "softfloat" to target "86Box" which is not
  built in this directory.

  This is allowed only when policy CMP0079 is set to NEW.


CMake Error at disk/CMakeLists.txt:25 (target_link_libraries):
  Attempt to add link library "minivhd" to target "86Box" which is not built
  in this directory.

  This is allowed only when policy CMP0079 is set to NEW.


CMake Error at network/CMakeLists.txt:32 (target_link_libraries):
  Attempt to add link library "slirp" to target "86Box" which is not built in
  this directory.

  This is allowed only when policy CMP0079 is set to NEW.


CMake Error at network/CMakeLists.txt:40 (target_link_libraries):
  Attempt to add link library "ws2_32" to target "86Box" which is not built
  in this directory.

  This is allowed only when policy CMP0079 is set to NEW.


CMake Error at sound/CMakeLists.txt:116 (target_link_libraries):
  Attempt to add link library "ymfm" to target "86Box" which is not built in
  this directory.

  This is allowed only when policy CMP0079 is set to NEW.


CMake Error at sound/CMakeLists.txt:128 (target_link_libraries):
  Attempt to add link library "resid-fp" to target "86Box" which is not built
  in this directory.

  This is allowed only when policy CMP0079 is set to NEW.


CMake Error at win/CMakeLists.txt:61 (target_link_libraries):
  Attempt to add link library "advapi32" to target "86Box" which is not built
  in this directory.

  This is allowed only when policy CMP0079 is set to NEW.


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.26)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!

I am not very familiar with cmake. I have mostly a make/autotools background.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions