CMake: Tidy up build system

And fix Windows CMake... who knows how long for.
This commit is contained in:
Stenzek
2024-04-20 20:26:53 +10:00
parent a88ee93b4d
commit 8867bb129a
14 changed files with 288 additions and 253 deletions

View File

@ -27,23 +27,17 @@ add_subdirectory(rcheevos EXCLUDE_FROM_ALL)
disable_compiler_warnings_for_target(rcheevos)
add_subdirectory(rapidyaml EXCLUDE_FROM_ALL)
disable_compiler_warnings_for_target(rapidyaml)
if(ENABLE_CUBEB)
add_subdirectory(cubeb EXCLUDE_FROM_ALL)
disable_compiler_warnings_for_target(cubeb)
disable_compiler_warnings_for_target(speex)
endif()
add_subdirectory(cubeb EXCLUDE_FROM_ALL)
disable_compiler_warnings_for_target(cubeb)
disable_compiler_warnings_for_target(speex)
add_subdirectory(discord-rpc EXCLUDE_FROM_ALL)
disable_compiler_warnings_for_target(discord-rpc)
if(ENABLE_OPENGL)
add_subdirectory(glad EXCLUDE_FROM_ALL)
disable_compiler_warnings_for_target(glad)
endif()
if(ENABLE_DISCORD_PRESENCE)
add_subdirectory(discord-rpc EXCLUDE_FROM_ALL)
disable_compiler_warnings_for_target(discord-rpc)
endif()
if(CPU_ARCH_X64)
add_subdirectory(xbyak EXCLUDE_FROM_ALL)
add_subdirectory(zydis EXCLUDE_FROM_ALL)

View File

@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.1 FATAL_ERROR)
CMAKE_MINIMUM_REQUIRED(VERSION 3.5 FATAL_ERROR)
# ---[ Project and semantic versioning.
PROJECT(clog C CXX)

View File

@ -20,11 +20,9 @@ if(WIN32)
src/wgl.c
)
else()
if(ENABLE_EGL)
target_sources(glad PRIVATE
include/EGL/eglplatform.h
include/glad/egl.h
src/egl.c
)
endif()
target_sources(glad PRIVATE
include/EGL/eglplatform.h
include/glad/egl.h
src/egl.c
)
endif()

View File

@ -27,6 +27,4 @@ target_include_directories(reshadefx INTERFACE
)
# reshadefx is not C++20-compatible.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set_property(TARGET reshadefx PROPERTY CXX_STANDARD 17)

View File

@ -1,13 +1,15 @@
add_library(WinPixEventRuntime::WinPixEventRuntime UNKNOWN IMPORTED GLOBAL)
add_library(WinPixEventRuntime::WinPixEventRuntime SHARED IMPORTED GLOBAL)
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64")
set_target_properties(WinPixEventRuntime::WinPixEventRuntime PROPERTIES
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/libarm64/WinPixEventRuntime.lib"
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/binarm64/WinPixEventRuntime.dll"
IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/libarm64/WinPixEventRuntime.lib"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include"
)
else()
set_target_properties(WinPixEventRuntime::WinPixEventRuntime PROPERTIES
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib64/WinPixEventRuntime.lib"
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/bin64/WinPixEventRuntime.dll"
IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/lib64/WinPixEventRuntime.lib"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include"
)
endif()