o3de / o3de

Open 3D Engine (O3DE) is an Apache 2.0-licensed multi-platform 3D engine that enables developers and content creators to build AAA games, cinema-quality 3D worlds, and high-fidelity simulations without any fees or commercial obligations.
https://o3de.org
Other
7.88k stars 2.22k forks source link

[macOS] Can't build on macOS due to undefined target Gem::Atom_RHI_Vulkan.Glad.Static #16588

Closed seapotter closed 1 year ago

seapotter commented 1 year ago

Describe the bug

macOS build failing because Gem::Atom_RHI_Vulkan.Glad.Static not found by CMake, this is because mac has ly_set(PAL_TRAIT_BUILD_HOST_TOOLS TRUE)

So Gem::Atom_RHI_Vulkan.Glad.Static is then looked for by this include, https://github.com/o3de/o3de/blame/34ccf5e6b4f3e27963b52d5cbb1ded7b85c12f3d/Gems/Atom/RHI/Vulkan/Code/CMakeLists.txt

but the actual target is omitted in cmake for macOS

Assets required [!Important!] Please provide sample assets needed to reproduce the issue, either as an attachment or as a link to a public asset in Github.

Steps to reproduce Steps to reproduce the behavior:

  1. Go to 'o3de/development'
  2. Sync
  3. Build with cmake -B build/mac -S . -G "Xcode" -DLY_3RDPARTY_PATH=$LY_3RDPARTY_PATH

Blew away build folder and cache, need to comment out line that includes it to generate project

Expected behavior Build is generated

Actual behavior

CMake Error at cmake/LYWrappers.cmake:553 (target_link_libraries):
  Target "Atom_RHI_Vulkan.Builders" links to:

    Gem::Atom_RHI_Vulkan.Glad.Static

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  CMakeLists.txt:110 (ly_delayed_target_link_libraries)

Screenshots/Video If applicable, add screenshots and/or a video to help explain your problem.

Found in Branch devolpment

Commit ID from o3de/o3de Repository 096bdf07cf21702ef44d400781ba9b7473c4bd42

Desktop/Device (please complete the following information):

Additional context Add any other context about the problem here.

lemonade-dm commented 1 year ago

@moudgils has a PR up that fixes this issue https://github.com/o3de/o3de/pull/16566/files#diff-5b9667d63fec3c9aa485fedb605b0f114ffb6ad7c567ae8d0baa2f300ac4ad2a