[cmake] fix issues when using CPMUTIL_FORCE_SYSTEM #399

Merged
crueter merged 6 commits from marcin-serwin/eden:push-oxnknwkznumv into master 2025-09-10 18:36:43 +02:00
Member
No description provided.
marcin-serwin added 1 commit 2025-09-09 23:03:13 +02:00
Signed-off-by: Marcin Serwin <marcin@serwin.dev>
crueter requested changes 2025-09-09 23:09:00 +02:00
CMakeLists.txt Outdated
@ -479,6 +480,15 @@ else()
endif()
endif()
# Xbyak (also used by Dynarmic and video_core so needs to be added first)
Owner

This isn't needed; we should instead do a find_package(xbyak) in root to propagate the target

This isn't needed; we should instead do a find_package(xbyak) in root to propagate the target
marcin-serwin marked this conversation as resolved
@ -0,0 +3,4 @@
include(FindPackageHandleStandardArgs)
find_package(PkgConfig QUIET)
Owner

Add MODULE to sirit find_args

Add MODULE to sirit find_args
marcin-serwin marked this conversation as resolved
@ -59,3 +62,3 @@
DESTINATION
${NX_TZDB_BASE_DIR})
else()
elseif(NOT EXISTS ${NX_TZDB_BASE_DIR})
Owner

This doesn't work since cpm uses a different src cache. It already doesn't download if it exists due to CPM

This doesn't work since cpm uses a different src cache. It already doesn't download if it exists due to CPM
Author
Member

This is deliberate, I want to use predownloaded tzdb so I put it in this path before running configuration, I don't use CPM or its cache for this. This is similar to how this worked in yuzu. Perhaps a better way to do it would be some cmake option to set the path beforehand like YUZU_PREDOWNLOADED_TZDB_PATH and we only use CPM if it's undefined? WDYT?

This is deliberate, I want to use predownloaded tzdb so I put it in this path before running configuration, I don't use CPM or its cache for this. This is similar to how this worked in yuzu. Perhaps a better way to do it would be some cmake option to set the path beforehand like `YUZU_PREDOWNLOADED_TZDB_PATH` and we only use CPM if it's undefined? WDYT?
Owner

You can use a predownloaded tzdb with tools/cpm-fetch.sh tzdb

You can use a predownloaded tzdb with `tools/cpm-fetch.sh tzdb`
Author
Member

But this involves running CPM and I want to avoid that.

But this involves running CPM and I want to avoid that.
Owner

The CPM fetch scripts are fully shell-based, they don't have any CMake going on. It's the same thing as predownloading with e.g wget, it just puts it in a place that CMake can use it.

The CPM fetch scripts are fully shell-based, they don't have any CMake going on. It's the same thing as predownloading with e.g wget, it just puts it in a place that CMake can use it.
Author
Member

This messes up hash of fixed output derivation in Nix and prevents reusing them between builds. I want to use the files predownloaded by Nix and not CPM or any bash script.

This messes up hash of fixed output derivation in Nix and prevents reusing them between builds. I want to use the files predownloaded by Nix and not CPM or any bash script.
Owner

Ah, okay; then let's add a set(YUZU_TZDB_PATH "" CACHE STRING "Path to a pre-downloaded timezone database"), and in nx_tzdb do an if(YUZU_TZDB_PATH) check before the MSVC check

Ah, okay; then let's add a `set(YUZU_TZDB_PATH "" CACHE STRING "Path to a pre-downloaded timezone database")`, and in nx_tzdb do an `if(YUZU_TZDB_PATH)` check before the MSVC check
Author
Member

Done

Done
marcin-serwin marked this conversation as resolved
Owner

actually we may be able to move xbyak to dynarmic externals? need to check

actually we may be able to move xbyak to dynarmic externals? need to check
marcin-serwin force-pushed push-oxnknwkznumv from 4f6d635edd to 3f7c4927bc 2025-09-10 17:08:10 +02:00 Compare
marcin-serwin force-pushed push-oxnknwkznumv from 3f7c4927bc to 9a9deced46 2025-09-10 18:18:23 +02:00 Compare
marcin-serwin force-pushed push-oxnknwkznumv from 9a9deced46 to 678cb591fd 2025-09-10 18:19:20 +02:00 Compare
crueter approved these changes 2025-09-10 18:33:09 +02:00
@ -36,3 +36,1 @@
# TODO(crueter): This is a terrible solution, but MSVC fails to link without it
# Need to investigate further but I still can't reproduce...
if (MSVC)
if(NOT YUZU_TZDB_PATH STREQUAL "")
Owner

STREQUAL "" is technically redundant, if already handles this case, but not a huge deal tbh

`STREQUAL ""` is technically redundant, `if` already handles this case, but not a huge deal tbh
Author
Member

I've had issues with this before and official docs indicate that if(<string>) doesn't really work like that: https://cmake.org/cmake/help/latest/command/if.html#string

I've had issues with this before and official docs indicate that `if(<string>)` doesn't really work like that: https://cmake.org/cmake/help/latest/command/if.html#string
crueter marked this conversation as resolved
MaranBr approved these changes 2025-09-10 18:36:00 +02:00
crueter merged commit 13ecc1e481 into master 2025-09-10 18:36:43 +02:00
crueter deleted branch push-oxnknwkznumv 2025-09-10 18:36:44 +02:00
Sign in to join this conversation.
No description provided.