Merge pull request #3086 from jeremy-lunarg/hayes-fix-3073

Guard AppleClang linker options
This commit is contained in:
Greg Fischer 2022-12-09 10:39:14 -07:00 committed by GitHub
commit 19d816c8c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -192,10 +192,10 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND NOT MSVC)
# Error if there's symbols that are not found at link time.
# add_link_options() was added in CMake 3.13 - if using an earlier
# version don't set this - it should be caught by presubmits anyway.
if (WIN32)
add_link_options("-Wl,--no-undefined")
else()
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
add_link_options("-Wl,-undefined,error")
else()
add_link_options("-Wl,--no-undefined")
endif()
endif()
elseif(MSVC)
@ -402,4 +402,4 @@ if(ENABLE_GLSLANG_INSTALL)
DESTINATION
"${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
)
endif()
endif()