From 2c745db54467dd548eea50cff69057d15eddab18 Mon Sep 17 00:00:00 2001 From: arcnmx Date: Fri, 23 Jul 2021 19:16:44 -0700 Subject: [PATCH] [host] windows: use CMAKE_DLLTOOL if available cmake automatically finds dlltool as of version 3.16 --- host/platform/Windows/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/host/platform/Windows/CMakeLists.txt b/host/platform/Windows/CMakeLists.txt index cd2f784b..a5bc1242 100644 --- a/host/platform/Windows/CMakeLists.txt +++ b/host/platform/Windows/CMakeLists.txt @@ -21,9 +21,12 @@ add_subdirectory("capture") if (MINGW) # Build our own ntdll.dll import library # This tricks MinGW into not linking stuff like memcpy from ntdll.dll instead of mscvrt.dll - find_program(DLLTOOL_EXECUTABLE NAMES "x86_64-w64-mingw32-dlltool" "dlltool.exe" DOC "dlltool executable") + if(NOT CMAKE_DLLTOOL) + # cmake older than 3.16 doesn't know how to find dlltool + find_program(CMAKE_DLLTOOL NAMES "x86_64-w64-mingw32-dlltool" "dlltool.exe" DOC "dlltool executable") + endif() add_custom_command(OUTPUT "${PROJECT_BINARY_DIR}/ntdll.a" - COMMAND "${DLLTOOL_EXECUTABLE}" -d "${PROJECT_SOURCE_DIR}/ntdll.def" -l "${PROJECT_BINARY_DIR}/ntdll.a" + COMMAND "${CMAKE_DLLTOOL}" -d "${PROJECT_SOURCE_DIR}/ntdll.def" -l "${PROJECT_BINARY_DIR}/ntdll.a" MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/ntdll.def" COMMENT "Building import library ntdll.a" VERBATIM