Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Windows Release with CMake (part 2) #61880

Merged
merged 44 commits into from
Dec 1, 2022

Conversation

alef
Copy link
Contributor

@alef alef commented Oct 23, 2022

Summary

None

Purpose of change

Try to align CMake build to match the release.

Describe the solution

  • Tidy up CMakeModules/
  • Provides draft documentation
  • Uses release.yml names for presets and scripts
  • Uses vswhere.exe

More details in commits comments.

Describe alternatives you've considered

Testing

It builds locally on VS 2022

  1. Drafting this PR
  2. Watch CI build
  3. Undraft if no side-effects

Additional context

Part of discarded #60159

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON [Markdown] Markdown issues and PRs Code: Build Issues regarding different builds and build environments astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Oct 23, 2022
@alef alef marked this pull request as ready for review October 23, 2022 12:49
Copy link
Member

@akrieger akrieger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't seem able to finish configuring this with my setup. Besides the ninja requirement it seems like something else is wrong.

C:\src\Cataclysm-DDA> cmake --preset windows-tiles-sounds-x64-msvc
Preset CMake variables:

  CMAKE_BUILD_TYPE="RelWithDebInfo"
  CMAKE_INSTALL_PREFIX:PATH="C:/src/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc"
  CMAKE_PROJECT_INCLUDE_BEFORE="C:/src/Cataclysm-DDA/build-scripts/windows-tiles-sounds-x64-msvc.cmake"
  CMAKE_TOOLCHAIN_FILE:FILEPATH="C:/src/Cataclysm-DDA/build-scripts/MSVC.cmake"
  CURSES="False"
  DYNAMIC_LINKING="False"
  LOCALIZE="True"
  TILES="True"
  VCPKG_OVERLAY_TRIPLETS="C:/src/Cataclysm-DDA/build-scripts"
  VCPKG_TARGET_TRIPLET="x64-windows-static"

CMake Error at build-scripts/VsDevCmd.cmake:39 (cmake_path):
  cmake_path undefined variable for input path.
Call Stack (most recent call first):
  build-scripts/windows-tiles-sounds-x64-msvc.cmake:24 (include)
  CMakeLists.txt:3 (project)


The system cannot find the path specified.
CMake Error at build-scripts/MSVC.cmake:86 (include):
  include could not find requested file:

    C:/vcpkg/scripts/buildsystems/vcpkg.cmake
Call Stack (most recent call first):
  out/build/windows-tiles-sounds-x64-msvc/CMakeFiles/3.25.0-rc2/CMakeSystem.cmake:6 (include)
  CMakeLists.txt:3 (project)


CMake Error at CMakeLists.txt:3 (project):
  Running

   '/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe' '--version'

  failed with:

   The system cannot find the file specified


-- Configuring incomplete, errors occurred!
See also "C:/src/Cataclysm-DDA/out/build/windows-tiles-sounds-x64-msvc/CMakeFiles/CMakeOutput.log".

I also suspect the x64-debug config is totally busted and should be deleted. It references a FindVCPKG file which doesn't seem to exist anymore.

Happy to iterate on figuring out what's different about my setup and how to handle it / document whats necessary. For example, it seems to assume vcpkg is at C:\vcpkg which is not globally true and not true for me either.

build-scripts/x64-windows-static.cmake Show resolved Hide resolved
CMakePresets.json Show resolved Hide resolved
CMakePresets.json Outdated Show resolved Hide resolved
@akrieger
Copy link
Member

akrieger commented Nov 3, 2022

It's still not resolving vcpkg correctly. I'm not sure if that's causing the downstream compiler errors or a separate issue.

$ cmake --preset windows-tiles-sounds-x64-msvc
Preset CMake variables:

  CMAKE_BUILD_TYPE="RelWithDebInfo"
  CMAKE_INSTALL_PREFIX:PATH="C:/src/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc"
  CMAKE_PROJECT_INCLUDE_BEFORE="C:/src/Cataclysm-DDA/build-scripts/windows-tiles-sounds-x64-msvc.cmake"
  CMAKE_TOOLCHAIN_FILE:FILEPATH="C:/src/Cataclysm-DDA/build-scripts/MSVC.cmake"
  CURSES="False"
  DYNAMIC_LINKING="False"
  LOCALIZE="True"
  TILES="True"
  VCPKG_OVERLAY_TRIPLETS="C:/src/Cataclysm-DDA/build-scripts"
  VCPKG_TARGET_TRIPLET="x64-windows-static"

-- Building for: Visual Studio 17 2022
CMake Error at build-scripts/VsDevCmd.cmake:39 (cmake_path):
  cmake_path undefined variable for input path.
Call Stack (most recent call first):
  build-scripts/windows-tiles-sounds-x64-msvc.cmake:24 (include)
  CMakeLists.txt:3 (project)


The system cannot find the path specified.
CMake Error at build-scripts/MSVC.cmake:86 (include):
  include could not find requested file:

    C:/vcpkg/scripts/buildsystems/vcpkg.cmake
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.25/Modules/CMakeDetermineSystem.cmake:124 (include)
  CMakeLists.txt:3 (project)


CMake Error at build-scripts/MSVC.cmake:86 (include):
  include could not find requested file:

    C:/vcpkg/scripts/buildsystems/vcpkg.cmake
Call Stack (most recent call first):
  out/build/windows-tiles-sounds-x64-msvc/CMakeFiles/3.25.0-rc2/CMakeSystem.cmake:6 (include)
  CMakeLists.txt:3 (project)


-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.19043.
-- The C compiler identification is MSVC 19.34.31921.1
-- The CXX compiler identification is MSVC 19.34.31921.1
-- Detecting C compiler ABI info
CMake Error at C:/src/Cataclysm-DDA/build-scripts/MSVC.cmake:86 (include):
  include could not find requested file:

    C:/vcpkg/scripts/buildsystems/vcpkg.cmake
Call Stack (most recent call first):
  C:/src/Cataclysm-DDA/out/build/windows-tiles-sounds-x64-msvc/CMakeFiles/3.25.0-rc2/CMakeSystem.cmake:6 (include)
  C:/src/Cataclysm-DDA/out/build/windows-tiles-sounds-x64-msvc/CMakeFiles/CMakeScratch/TryCompile-fll7jl/CMakeLists.txt:5 (project)


CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/CMakeDetermineCompilerABI.cmake:57 (try_compile):
  Failed to configure test project build system.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.25/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)
  CMakeLists.txt:3 (project)


-- Configuring incomplete, errors occurred!
See also "C:/src/Cataclysm-DDA/out/build/windows-tiles-sounds-x64-msvc/CMakeFiles/CMakeOutput.log".

@alef
Copy link
Contributor Author

alef commented Nov 4, 2022

For example, it seems to assume vcpkg is at C:\vcpkg which is not globally true and not true for me either.

I have moved it into CMakePresets.json. You can edit there or use -DVCPKG_ROOT=Z:/somewhere/vcpkg

@akrieger
Copy link
Member

akrieger commented Nov 4, 2022

I have moved it into CMakePresets.json. You can edit there or use -DVCPKG_ROOT=Z:/somewhere/vcpkg

Or set VCPKG_INSTALLATION_ROOT if I'm reading it right?

@alef
Copy link
Contributor Author

alef commented Nov 4, 2022

VCPKG_INSTALLATION_ROOT yes, as by Mitigation ways in actions/runner-images#6376

@akrieger
Copy link
Member

akrieger commented Nov 4, 2022

We use run_vcpkg which sets VCPKG_ROOT env var itself. Could we not still rely on that same env var because it's the default/convention outside of GHA runners? It looks like VCPKG_INSTALLATION_ROOT is going to be a GHA specific variable. Or am I misunderstand here, will VCPKG_ROOT also work when set as an env var and not via -D?

@alef
Copy link
Contributor Author

alef commented Nov 4, 2022

Or am I misunderstand here, will VCPKG_ROOT also work when set as an env var and not via -D?

MSVC.cmake always use env VCPKG_ROOT.

This env is set by env VCPKG_INSTALLATION_ROOT when defined, or by cache var VCPKG_ROOT (-D) if env VCPKG_ROOT is not defined.

This logic is at begin of windows-tiles-sounds-x64-msvc.cmake.

@alef alef requested a review from akrieger November 8, 2022 07:55
Copy link
Member

@akrieger akrieger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, it seems to build now after I set VCPKG_ROOT in my env, but the output confuses me. It seems to build with optimizations disabled but with the release CRT. I would expect it to build with optimizations enabled and the release CRT. Is that because that's what RelWithDebInfo maps to?

Sample build output

Lib:
  C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.34.31933\bin\HostX64\x64\Lib.exe /OUT:"cataclysm-tiles-common.dir\Debug\cataclysm-tiles-co
  mmon.lib" /NOLOGO /MACHINE:X64  /machine:x64 "cataclysm-tiles-common.dir\Debug\cmake_pch.obj"
  "cataclysm-tiles-common.dir\Debug\achievement.obj"
  "cataclysm-tiles-common.dir\Debug\action.obj"
  ...
  
  C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.34.31933\bin\HostX64\x64\CL.exe /c /I"O:\open\personal\Cataclysm-DDA\src" /Zi /nologo /W1
  /WX- /diagnostics:column /sdl- /MP /Od /Ob0 /D _MBCS /D WIN32 /D _WINDOWS /D _SCL_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_WARNINGS /D WIN32_LEAN_AND_MEAN /D LOCALIZ
  E /D USE_VCPKG /D CMAKE /D GIT_VERSION /D RELEASE /D _AMD64_ /D TILES /D BACKTRACE /D USE_HOME_DIR /D CATCH_CONFIG_ENABLE_BENCHMARKING /D "CMAKE_INTDIR=\"Debug\"
  " /GF /Gm- /EHsc /RTC1 /MT /GS- /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /std:c++14 /permissive- /Yu"O:/open/personal/Cataclysm-DDA/out/build/windows-
  tiles-sounds-x64-msvc/tests/CMakeFiles/cata_test-tiles.dir/Debug/cmake_pch.hxx" /Fp"O:/open/personal/Cataclysm-DDA/out/build/windows-tiles-sounds-x64-msvc/tests/
  cata_test-tiles.dir/Debug/cmake_pch.pch" /Fo"cata_test-tiles.dir\Debug\\" /Fd"cata_test-tiles.dir\Debug\vc143.pdb" /external:W0 /Gd /TP /wd4068 /wd4146 /wd4819 /
  wd6237 /wd6319 /wd26444 /wd26451 /wd26495 /FI"O:/open/personal/Cataclysm-DDA/out/build/windows-tiles-sounds-x64-msvc/tests/CMakeFiles/cata_test-tiles.dir/Debug/c
  make_pch.hxx" /FC /errorReport:queue  /external:I "O:/open/personal/Cataclysm-DDA/out/build/windows-tiles-sounds-x64-msvc/vcpkg_installed/x64-windows-static/incl
  ude" /external:I "O:/open/personal/Cataclysm-DDA/out/build/windows-tiles-sounds-x64-msvc/vcpkg_installed/x64-windows-static/include/SDL2" /external:I "O:/open/pe
  rsonal/Cataclysm-DDA/src/third-party" /utf-8 /bigobj "O:\open\personal\Cataclysm-DDA\tests\act_build_test.cpp" "O:\open\personal\Cataclysm-DDA\tests\active_item_
  cache_test.cpp" ...

The install step errors out though with

akrieger@d-sov5b34umi MINGW64 /o/open/personal/Cataclysm-DDA
$ cmake --install out/build/windows-tiles-sounds-x64-msvc
-- Install configuration: "Release"
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/de
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/de/LC_MESSAGES
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/de/LC_MESSAGES/cataclysm-dda.mo
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/es_AR
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/es_AR/LC_MESSAGES
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/es_AR/LC_MESSAGES/cataclysm-dda.mo
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/es_ES
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/es_ES/LC_MESSAGES
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/es_ES/LC_MESSAGES/cataclysm-dda.mo
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/fr
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/fr/LC_MESSAGES
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/fr/LC_MESSAGES/cataclysm-dda.mo
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/it_IT
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/it_IT/LC_MESSAGES
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/it_IT/LC_MESSAGES/cataclysm-dda.mo
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/ja
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/ja/LC_MESSAGES
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/ja/LC_MESSAGES/cataclysm-dda.mo
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/ko
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/ko/LC_MESSAGES
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/ko/LC_MESSAGES/cataclysm-dda.mo
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/pt_BR
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/pt_BR/LC_MESSAGES
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/pt_BR/LC_MESSAGES/cataclysm-dda.mo
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/ru
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/ru/LC_MESSAGES
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/ru/LC_MESSAGES/cataclysm-dda.mo
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/zh_CN
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/zh_CN/LC_MESSAGES
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/zh_CN/LC_MESSAGES/cataclysm-dda.mo
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/zh_TW
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/zh_TW/LC_MESSAGES
-- Installing: O:/open/personal/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc/lang/mo/zh_TW/LC_MESSAGES/cataclysm-dda.mo
CMake Error at out/build/windows-tiles-sounds-x64-msvc/src/cmake_install.cmake:60 (file):
  file INSTALL cannot find
  "O:/open/personal/Cataclysm-DDA/out/build/windows-tiles-sounds-x64-msvc/src/Release/cataclysm-tiles.exe":
  File exists.
Call Stack (most recent call first):
  out/build/windows-tiles-sounds-x64-msvc/cmake_install.cmake:42 (include)

'requesting changes' to add the vcpkg instructionss, clarification around expected build configuration, and to debug the install flow.

doc/COMPILING/COMPILING-CMAKE-VCPKG.md Outdated Show resolved Hide resolved
doc/COMPILING/COMPILING-CMAKE-VCPKG.md Outdated Show resolved Hide resolved
@alef
Copy link
Contributor Author

alef commented Nov 8, 2022

It seems to build with optimizations disabled but with the release CRT. I would expect it to build with optimizations enabled and the release CRT. Is that because that's what RelWithDebInfo maps to?

Edit: here the vimdiff between the the compiler and linker command lines from Release configuration in Cataclysm-vcpkg-static.sln, and the same created by CMake VS generator. Rearranged for diff clarity:
CL-Diff.html.gz
LINK-Diff.html.gz

@alef
Copy link
Contributor Author

alef commented Nov 8, 2022

The install step errors out though with

akrieger@d-sov5b34umi MINGW64 /o/open/personal/Cataclysm-DDA
$ cmake --install out/build/windows-tiles-sounds-x64-msvc
[...]
CMake Error at out/build/windows-tiles-sounds-x64-msvc/src/cmake_install.cmake:60 (file):
  file INSTALL cannot find
  "O:/open/personal/Cataclysm-DDA/out/build/windows-tiles-sounds-x64-msvc/src/Release/cataclysm-tiles.exe":
  File exists.
Call Stack (most recent call first):
  out/build/windows-tiles-sounds-x64-msvc/cmake_install.cmake:42 (include)

It is a problem with the VS/MSBuild generator. It works using Ninja. I will check what can be done.

@akrieger
Copy link
Member

akrieger commented Nov 8, 2022

I ran the generate and build steps exactly like specified in the doc, so maybe the ninja build does the right thing as far as compile flags, and it's the msbuild generator which mine defaulted to which uses /Od /Ob0. I don't know what to tell you, I'm just following the directions exactly as written and giving you the feedback/results :)

@alef
Copy link
Contributor Author

alef commented Nov 9, 2022

I ran the generate and build steps exactly like specified in the doc, so maybe the ninja build does the right thing as far as compile flags, and it's the msbuild generator which mine defaulted to which uses /Od /Ob0. I don't know what to tell you, I'm just following the directions exactly as written and giving you the feedback/results :)

If the selected CMake generator supports multi-configuration like Visual Studio, then CMAKE_BUILD_TYPE is ignored. This means I need to add --config RelWithDebInfo.

@alef alef requested a review from akrieger November 9, 2022 18:45
@alef alef requested a review from BrettDong as a code owner November 15, 2022 09:40
@github-actions github-actions bot added Translation I18n and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Nov 15, 2022
Copy link
Member

@akrieger akrieger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran the steps through visual studio but cmake configure didn't manage to finish correctly. I set VCPKG_ROOT correctly as an env var, which let vcpkg try to actually pass, but something isn't working right with the installed packages. Full output is at https://gist.github.com/akrieger/2b91997b4748fc822af742fb25ce3642

1> [CMake] -- Searching for SDL2 library --
1> [CMake] -- Searching for SDL deps libraries --
1> [CMake] -- Found Freetype: C:/code/Cataclysm-DDA/out/build/windows-tiles-sounds-x64-msvc/vcpkg_installed/x64-windows-static/lib/freetype.lib (found version "2.11.1") 
1> [CMake] -- Found PNG: C:/code/Cataclysm-DDA/out/build/windows-tiles-sounds-x64-msvc/vcpkg_installed/x64-windows-static/lib/libpng16.lib (found version "1.6.37") 
1> [CMake] -- Searching for SDL2_TTF library --
1> [CMake] CMake Warning at C:/code/vcpkg/scripts/buildsystems/vcpkg.cmake:824 (_find_package):
1> [CMake]   By not providing "FindSDL2_ttf.cmake" in CMAKE_MODULE_PATH this project has
1> [CMake]   asked CMake to find a package configuration file provided by "SDL2_ttf",
1> [CMake]   but CMake did not find one.
1> [CMake] 
1> [CMake]   Could not find a package configuration file provided by "SDL2_ttf" with any
1> [CMake]   of the following names:
1> [CMake] 
1> [CMake]     SDL2_ttfConfig.cmake
1> [CMake]     sdl2_ttf-config.cmake
1> [CMake] 
1> [CMake]   Add the installation prefix of "SDL2_ttf" to CMAKE_PREFIX_PATH or set
1> [CMake]   "SDL2_ttf_DIR" to a directory containing one of the above files.  If
1> [CMake]   "SDL2_ttf" provides a separate development package or SDK, be sure it has
1> [CMake]   been installed.
1> [CMake] Call Stack (most recent call first):
1> [CMake]   CMakeLists.txt:296 (find_package)
1> [CMake] 
1> [CMake] 
1> [CMake] CMake Error at C:\code\Cataclysm-DDA\CMakeLists.txt:298 (message):
1> [CMake]   This project requires SDL2_ttf to be installed to compile in graphical
1> [CMake]   mode.  Please install the SDL2_ttf development libraries, or try compiling
1> [CMake]   without -DTILES=1 for a text-only compilation.  See
1> [CMake]   doc/COMPILING/COMPILING-CMAKE.md for details and more info.
1> [CMake] 

I followed the terminal instructions from my msys2 shell and got errors due to not having cl.exe on path.

Andrew@CRUSHER MINGW64 /c/code/Cataclysm-DDA
$ cmake --preset windows-tiles-sounds-x64-msvc
Preset CMake variables:

  CMAKE_BUILD_TYPE="RelWithDebInfo"
  CMAKE_INSTALL_PREFIX:PATH="C:/code/Cataclysm-DDA/out/install/windows-tiles-sounds-x64-msvc"
  CMAKE_PROJECT_INCLUDE_BEFORE="C:/code/Cataclysm-DDA/build-scripts/windows-tiles-sounds-x64-msvc.cmake"
  CMAKE_TOOLCHAIN_FILE:FILEPATH="C:/code/Cataclysm-DDA/build-scripts/MSVC.cmake"
  CURSES="False"
  DYNAMIC_LINKING="False"
  LOCALIZE="True"
  RELEASE="True"
  TILES="True"
  VCPKG_OVERLAY_TRIPLETS="C:/code/Cataclysm-DDA/build-scripts"
  VCPKG_ROOT="C:/vcpkg"
  VCPKG_TARGET_TRIPLET="x64-windows-static"

CMake Error at build-scripts/VsDevCmd.cmake:39 (cmake_path):
  cmake_path undefined variable for input path.
Call Stack (most recent call first):
  build-scripts/windows-tiles-sounds-x64-msvc.cmake:24 (include)
  CMakeLists.txt:3 (project)


The system cannot find the path specified.
-- Running vcpkg install
Detecting compiler hash for triplet x64-windows...
Detecting compiler hash for triplet x64-windows-static...
All requested packages are currently installed.
Restored 0 packages from C:\Users\Andrew\AppData\Local\vcpkg\archives in 151.1 us. Use --debug to see more details.

Total elapsed time: 3.604 s

The package sdl2 provides CMake targets:

    find_package(SDL2 CONFIG REQUIRED)
    target_link_libraries(main PRIVATE SDL2::SDL2 SDL2::SDL2main SDL2::SDL2-static)

The package sdl2-image provides CMake targets:

    find_package(sdl2-image CONFIG REQUIRED)
    target_link_libraries(main PRIVATE SDL2::SDL2_image)

The package sdl2-mixer provides CMake targets:

    find_package(sdl2-mixer CONFIG REQUIRED)
    target_link_libraries(main PRIVATE SDL2::SDL2_mixer)

The package sdl2-ttf provides CMake targets:

    find_package(sdl2-ttf CONFIG REQUIRED)
    target_link_libraries(main PRIVATE SDL2::SDL2_ttf)

-- Running vcpkg install - done
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
  The CMAKE_C_COMPILER:

    cl.exe

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:3 (project):
  The CMAKE_CXX_COMPILER:

    cl.exe

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "C:/code/Cataclysm-DDA/out/build/windows-tiles-sounds-x64-msvc/CMakeFiles/CMakeOutput.log".
See also "C:/code/Cataclysm-DDA/out/build/windows-tiles-sounds-x64-msvc/CMakeFiles/CMakeError.log".

I ran the terminal instructions from a VS developer command prompt which then encountered the same "Searching for SDL2_TTF library" error.

My vcpkg repo is at commit 659b6b5eeacb50ffe25856413960d231ce1a4b58 which is the same one specified in the cdda docs.

doc/COMPILING/COMPILING-CMAKE-VCPKG.md Outdated Show resolved Hide resolved
doc/COMPILING/COMPILING-CMAKE-VCPKG.md Outdated Show resolved Hide resolved
doc/COMPILING/COMPILING-CMAKE-VCPKG.md Outdated Show resolved Hide resolved
CMakeParseArguments.cmake since v3.4
CMakePushCheckState.cmake since v2.8.6
CheckLibraryExists since v2.8.2
FindCurses since v3.21.0
FindPackageHandleStandardArgs since v3.1.0
FindPackageMessage since v3.0.0
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Nov 28, 2022
@alef
Copy link
Contributor Author

alef commented Nov 28, 2022

So I did a kind of diff <(tree github-windows-release/ ) <(tree my-installed-windows/) and this is what is left:

< data/application_manifest.txt
< data/CMakeLists.txt
> data/core/TEST_DATA/lang/mo/ru/TEST_DATA.mo
< data/sound/
< json_formatter.exe

CMakeLists.txt Show resolved Hide resolved
Copy link
Member

@akrieger akrieger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visual studio cmake flow seems to work. I can build, install, and launch. CI cmake flows don't seem broken. I think fixing install to include sound so at least the Basic soundpack is there would be good but functionally the build seems to be all there.

@alef I'll wait to see if you include sound in the install or tell me you'll pass, then I'll post this for ready-to-merge.

@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Nov 30, 2022
@akrieger
Copy link
Member

akrieger commented Dec 1, 2022

🎉

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Dec 1, 2022
@kevingranade kevingranade merged commit 90bc485 into CleverRaven:master Dec 1, 2022
@alef alef deleted the cmake-presets-part2 branch December 1, 2022 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions Code: Build Issues regarding different builds and build environments Code: Tests Measurement, self-control, statistics, balancing. <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Translation I18n
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants