Skip to content

Commit fa0cf5d

Browse files
committed
aui.boot.cmake: better diagnostics for precompiled libraries
1 parent d9d49a0 commit fa0cf5d

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

aui.boot.cmake

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,8 @@ endif()
116116
set(BUILD_SHARED_LIBS ${_build_shared})
117117

118118
if (MSVC)
119-
if(AUI_BUILD_FOR STREQUAL "winxp")
120-
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>" CACHE STRING "" FORCE)
121-
if (NOT DEFINED CMAKE_TOOLCHAIN_FILE)
122-
set(CMAKE_TOOLCHAIN_FILE ${AUI_BUILD_AUI_ROOT}/cmake/toolchains/winxp-x86.cmake)
123-
endif()
124-
else()
125-
if(NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
126-
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL" CACHE STRING "" FORCE)
127-
endif()
119+
if (NOT CMAKE_MSVC_RUNTIME_LIBRARY)
120+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
128121
message(STATUS "AUI.Boot CMAKE_MSVC_RUNTIME_LIBRARY is not set - defaulting to ${CMAKE_MSVC_RUNTIME_LIBRARY}")
129122
endif()
130123
endif()
@@ -423,13 +416,15 @@ function(_auib_try_download_precompiled_binary)
423416
message(STATUS "GitHub detected, checking for precompiled package...")
424417
endif()
425418

419+
set(_diagnostics "")
426420
foreach(_binary_download_url ${_binary_download_urls})
427421
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.19)
428422
# since CMake 3.19 there's a way to check for file existence
429423

430424
file(DOWNLOAD ${_binary_download_url} STATUS _status)
431-
list(GET _status 0 _status)
432-
if (NOT _status STREQUAL 0)
425+
list(GET _status 0 _status_code)
426+
if (NOT _status_code STREQUAL 0)
427+
list(APPEND _diagnostics "\n${_binary_download_url} : ${_status}")
433428
continue()
434429
endif()
435430
endif()
@@ -455,11 +450,8 @@ function(_auib_try_download_precompiled_binary)
455450
return()
456451
endif()
457452
endforeach()
458-
if (AUIB_DEBUG_PRECOMPILED STREQUAL ${AUI_MODULE_NAME})
459-
message(FATAL_ERROR "Precompiled binary for ${AUI_MODULE_NAME} is not available"
460-
"\ntrace: download urls: ${_binary_download_urls}")
461-
endif()
462-
message(STATUS "Precompiled binary for ${AUI_MODULE_NAME} is not available")
453+
message(STATUS "Precompiled binary for ${AUI_MODULE_NAME} is not available"
454+
"\nNote: tried following urls: ${_diagnostics}")
463455
endfunction()
464456

465457
function(_auib_dump_with_prefix PREFIX PATH)

0 commit comments

Comments
 (0)