From 436547b44fa5054235895881a795f48ff87d2065 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Fri, 1 Nov 2024 13:57:48 -0700 Subject: [PATCH] Fix for CMake using MinGW --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c8d413c..42add9aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -310,7 +310,11 @@ endif() if(MINGW) find_package(directxmath CONFIG REQUIRED) + target_link_libraries(${PROJECT_NAME} PUBLIC Microsoft::DirectXMath) + find_package(directx-headers CONFIG REQUIRED) + target_link_libraries(${PROJECT_NAME} PUBLIC Microsoft::DirectX-Headers) + target_compile_definitions(${PROJECT_NAME} PUBLIC USING_DIRECTX_HEADERS) else() find_package(directxmath CONFIG QUIET) find_package(directx-headers CONFIG QUIET) @@ -318,13 +322,13 @@ endif() if(directxmath_FOUND) message(STATUS "Using DirectXMath package") - target_link_libraries(${PROJECT_NAME} PUBLIC Microsoft::DirectXMath) + target_link_libraries(${PROJECT_NAME} PRIVATE Microsoft::DirectXMath) endif() if(directx-headers_FOUND) message(STATUS "Using DirectX-Headers package") - target_link_libraries(${PROJECT_NAME} PUBLIC Microsoft::DirectX-Headers) - target_compile_definitions(${PROJECT_NAME} PUBLIC USING_DIRECTX_HEADERS) + target_link_libraries(${PROJECT_NAME} PRIVATE Microsoft::DirectX-Headers) + target_compile_definitions(${PROJECT_NAME} PRIVATE USING_DIRECTX_HEADERS) endif() if(BUILD_XAUDIO_REDIST