From 698df6884d315d7856c7859f70476817334f4af0 Mon Sep 17 00:00:00 2001 From: Joe Mou <1091031+jmou@users.noreply.github.com> Date: Mon, 16 Sep 2024 19:31:44 -0400 Subject: [PATCH] build(cmake): Prioritize vendored includes over system-wide (#3182) --- cmake/compile_definitions/common.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmake/compile_definitions/common.cmake b/cmake/compile_definitions/common.cmake index 7b13168a60e..02ec72247c4 100644 --- a/cmake/compile_definitions/common.cmake +++ b/cmake/compile_definitions/common.cmake @@ -48,12 +48,12 @@ elseif(UNIX) endif() endif() -include_directories(SYSTEM "${CMAKE_SOURCE_DIR}/third-party/nv-codec-headers/include") +include_directories(BEFORE SYSTEM "${CMAKE_SOURCE_DIR}/third-party/nv-codec-headers/include") file(GLOB NVENC_SOURCES CONFIGURE_DEPENDS "src/nvenc/*.cpp" "src/nvenc/*.h") list(APPEND PLATFORM_TARGET_FILES ${NVENC_SOURCES}) configure_file("${CMAKE_SOURCE_DIR}/src/version.h.in" version.h @ONLY) -include_directories("${CMAKE_CURRENT_BINARY_DIR}") # required for importing version.h +include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}") # required for importing version.h set(SUNSHINE_TARGET_FILES "${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/src/Input.h" @@ -129,9 +129,10 @@ list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_PUBLISHER_NAME="${SUNSHINE_PUBLISHER_N list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_PUBLISHER_WEBSITE="${SUNSHINE_PUBLISHER_WEBSITE}") list(APPEND SUNSHINE_DEFINITIONS SUNSHINE_PUBLISHER_ISSUE_URL="${SUNSHINE_PUBLISHER_ISSUE_URL}") -include_directories("${CMAKE_SOURCE_DIR}") +include_directories(BEFORE "${CMAKE_SOURCE_DIR}") include_directories( + BEFORE SYSTEM "${CMAKE_SOURCE_DIR}/third-party" "${CMAKE_SOURCE_DIR}/third-party/moonlight-common-c/enet/include"