BUILD(cmake): Fix detection of unbundled GSL

Microsoft.GSL exports the Microsoft.GSL::GSL target. If the namespace
isn't specified, the detection moves on the else() block, and while
it still gets detected by FindMSGSL.cmake, a false warning is emitted
saying that the version is less than 3.0.
This commit is contained in:
Jason E. Hale 2023-08-18 10:18:50 -04:00
parent c338d1df3b
commit 19e01f7255

View File

@ -217,8 +217,8 @@ else()
# GSL since version 3)
find_pkg("Microsoft.GSL")
if (TARGET GSL)
target_link_libraries(shared PUBLIC GSL)
if (TARGET Microsoft.GSL::GSL)
target_link_libraries(shared PUBLIC Microsoft.GSL::GSL)
else()
# If the above failed, it could mean that there is an installation of GSL < v3.0 on this system, which does not yet
# provide cmake support for finding it. Thus, we have to use our custom Find-script.