[cmake] fix freebsd and openbsd, remove CPMUtil Eden copyright (#496)
CPMUtil is technically a completely separate project created and maintained solely by me, so it should actually be copyrighted to me Reviewed-on: #496 Reviewed-by: MaranBr <maranbr@eden-emu.dev>
This commit is contained in:
parent
19036c59b5
commit
6699361b7e
3 changed files with 43 additions and 25 deletions
|
@ -44,6 +44,13 @@ if (PLATFORM_SUN)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
# Needed for FFmpeg w/ VAAPI and DRM
|
||||
if (PLATFORM_OPENBSD)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/X11R6/include")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/X11R6/include")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/X11R6/lib")
|
||||
endif()
|
||||
|
||||
# Detect current compilation architecture and create standard definitions
|
||||
# =======================================================================
|
||||
|
||||
|
@ -88,7 +95,7 @@ message(STATUS "Target architecture: ${ARCHITECTURE}")
|
|||
|
||||
if (MSVC AND ARCHITECTURE_x86)
|
||||
message(FATAL_ERROR "Attempting to build with the x86 environment is not supported. \
|
||||
This can typically happen if you used the Developer Command Prompt from the start menu;\
|
||||
This can typically happen if you used the Developer Command Prompt from the start menu; \
|
||||
instead, run vcvars64.bat directly, located at C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat")
|
||||
endif()
|
||||
|
||||
|
@ -122,7 +129,7 @@ include(CMakeDependentOption)
|
|||
include(CTest)
|
||||
|
||||
# Disable Warnings as Errors for MSVC
|
||||
if (CXX_CL)
|
||||
if (MSVC AND NOT CXX_CLANG)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /WX-")
|
||||
endif()
|
||||
|
||||
|
@ -485,13 +492,32 @@ else()
|
|||
find_package(Opus 1.3 MODULE REQUIRED)
|
||||
find_package(ZLIB 1.2 REQUIRED)
|
||||
find_package(zstd 1.5 REQUIRED MODULE)
|
||||
find_package(Boost 1.57.0 REQUIRED context system fiber)
|
||||
find_package(MbedTLS 3)
|
||||
|
||||
# wow
|
||||
if (PLATFORM_LINUX)
|
||||
find_package(Boost 1.57.0 REQUIRED headers context system fiber)
|
||||
else()
|
||||
find_package(Boost 1.57.0 REQUIRED)
|
||||
endif()
|
||||
|
||||
# OpenBSD does not package mbedtls3 (only 2)
|
||||
if (PLATFORM_OPENBSD)
|
||||
AddJsonPackage(mbedtls)
|
||||
else()
|
||||
find_package(MbedTLS 3 REQUIRED)
|
||||
endif()
|
||||
|
||||
find_package(VulkanUtilityLibraries REQUIRED)
|
||||
find_package(VulkanHeaders 1.3.274 REQUIRED)
|
||||
|
||||
# FreeBSD does not package spirv-headers
|
||||
if (PLATFORM_FREEBSD)
|
||||
AddJsonPackage(spirv-headers)
|
||||
else()
|
||||
find_package(SPIRV-Headers 1.3.274 REQUIRED)
|
||||
endif()
|
||||
|
||||
find_package(SPIRV-Tools MODULE REQUIRED)
|
||||
find_package(SPIRV-Headers 1.3.274 REQUIRED)
|
||||
|
||||
if (YUZU_TESTS)
|
||||
find_package(Catch2 3.0.1 REQUIRED)
|
||||
|
|
|
@ -1,17 +1,6 @@
|
|||
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# SPDX-FileCopyrightText: Copyright 2025 crueter
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Created-By: crueter
|
||||
# Docs will come at a later date, mostly this is to just reduce boilerplate
|
||||
# and some cmake magic to allow for runtime viewing of dependency versions
|
||||
|
||||
# Future crueter: Wow this was a lie and a half, at this point I might as well make my own CPN
|
||||
# haha just kidding... unless?
|
||||
|
||||
# TODO(crueter): Remember to get more than 6 hours of sleep whenever making giant cmake changes
|
||||
if (MSVC OR ANDROID)
|
||||
set(BUNDLED_DEFAULT ON)
|
||||
else()
|
||||
|
@ -27,6 +16,7 @@ option(CPMUTIL_FORCE_SYSTEM
|
|||
cmake_minimum_required(VERSION 3.22)
|
||||
include(CPM)
|
||||
|
||||
# cpmfile parsing
|
||||
set(CPMUTIL_JSON_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cpmfile.json")
|
||||
|
||||
if (EXISTS ${CPMUTIL_JSON_FILE})
|
||||
|
@ -35,12 +25,11 @@ else()
|
|||
message(WARNING "[CPMUtil] cpmfile ${CPMUTIL_JSON_FILE} does not exist, AddJsonPackage will be a no-op")
|
||||
endif()
|
||||
|
||||
# utility
|
||||
# Utility stuff
|
||||
function(cpm_utils_message level name message)
|
||||
message(${level} "[CPMUtil] ${name}: ${message}")
|
||||
endfunction()
|
||||
|
||||
# utility
|
||||
function(array_to_list array length out)
|
||||
math(EXPR range "${length} - 1")
|
||||
|
||||
|
@ -53,7 +42,6 @@ function(array_to_list array length out)
|
|||
set("${out}" "${NEW_LIST}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# utility
|
||||
function(get_json_element object out member default)
|
||||
string(JSON out_type ERROR_VARIABLE err TYPE "${object}" ${member})
|
||||
|
||||
|
@ -73,14 +61,13 @@ function(get_json_element object out member default)
|
|||
set("${out}" "${outvar}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Kinda cancerous but whatever
|
||||
# The preferred usage
|
||||
function(AddJsonPackage)
|
||||
set(oneValueArgs
|
||||
NAME
|
||||
|
||||
# these are overrides that can be generated at runtime, so can be defined separately from the json
|
||||
DOWNLOAD_ONLY
|
||||
SYSTEM_PACKAGE
|
||||
BUNDLED_PACKAGE
|
||||
)
|
||||
|
||||
|
@ -90,6 +77,7 @@ function(AddJsonPackage)
|
|||
"${ARGN}")
|
||||
|
||||
list(LENGTH ARGN argnLength)
|
||||
|
||||
# single name argument
|
||||
if(argnLength EQUAL 1)
|
||||
set(JSON_NAME "${ARGV0}")
|
||||
|
@ -199,7 +187,6 @@ function(AddJsonPackage)
|
|||
endif()
|
||||
|
||||
set(options ${options} ${JSON_OPTIONS})
|
||||
|
||||
# end options
|
||||
|
||||
# system/bundled
|
||||
|
@ -241,7 +228,7 @@ endfunction()
|
|||
function(AddPackage)
|
||||
cpm_set_policies()
|
||||
|
||||
# TODO(crueter): docs, git clone
|
||||
# TODO(crueter): git clone?
|
||||
|
||||
#[[
|
||||
URL configurations, descending order of precedence:
|
||||
|
|
9
externals/libusb/CMakeLists.txt
vendored
9
externals/libusb/CMakeLists.txt
vendored
|
@ -1,15 +1,19 @@
|
|||
# SPDX-FileCopyrightText: 2025 Eden Emulator Project
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# SPDX-FileCopyrightText: 2020 yuzu Emulator Project
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
include(CPMUtil)
|
||||
|
||||
if (PLATFORM_SUN OR PLATFORM_OPENBSD OR PLATFORM_FREEBSD)
|
||||
# we love our libraries don't we folks
|
||||
if (PLATFORM_SUN)
|
||||
set(libusb_bundled ON)
|
||||
else()
|
||||
set(libusb_bundled OFF)
|
||||
endif()
|
||||
|
||||
# TODO(crueter): Fix on *BSD/Solaris
|
||||
# TODO(crueter): Fix on Solaris
|
||||
AddJsonPackage(
|
||||
NAME libusb
|
||||
BUNDLED_PACKAGE ${libusb_bundled}
|
||||
|
@ -19,6 +23,7 @@ if (NOT libusb_ADDED)
|
|||
return()
|
||||
endif()
|
||||
|
||||
# TODO: *BSD fails to compile--may need different configs/symbols
|
||||
if (MINGW OR PLATFORM_LINUX OR APPLE)
|
||||
set(LIBUSB_FOUND ON CACHE BOOL "libusb is present" FORCE)
|
||||
set(LIBUSB_VERSION "1.0.24" CACHE STRING "libusb version string" FORCE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue