Set CMAKE_C_LIBRARY_ARCHITECTURE for newer versions of CMake. The
CMAKE_LIBRARY_ARCHITECTURE is a meta-variable that is set from the
value of CMAKE_<LANG>_LIBRARY_ARCHITECTURE in at least 3.15 onward.
# without searching in the Lib directory first appears to be to set
# CMAKE_LIBRARY_ARCHITECTURE to "x64".
#
+ # In newer versions of CMake, CMAKE_LIBRARY_ARCHITECTURE is set according to
+ # the language, e.g., CMAKE_<LANG>_LIBRARY_ARCHITECTURE. So, set the new
+ # variable, CMAKE_C_LIBRARY_ARCHITECTURE, so that CMAKE_LIBRARY_ARCHITECTURE
+ # inherits the correct value.
+ #
+ set(CMAKE_C_LIBRARY_ARCHITECTURE "x64")
set(CMAKE_LIBRARY_ARCHITECTURE "x64")
endif()