Commit 195d416e authored by Michael's avatar Michael Committed by Sergiu Deitsch

Add target existence checks to Unwind find module (#518)

* Add target existence checks to Unwind find module

The build systems of projects depending on Glog may call the Unwind find
module multiple times. In these cases, the current unwind find module tries
to create a duplicate unwind::unwind target, crashing the build. This
patch adds an existence check before target creation to fix this issue.
Signed-off-by: 's avatarMichael Darr <mdarr@matician.com>

* Alphabetize contributor list

* Fix inconsistent CMake style
Signed-off-by: 's avatarMichael Darr <medarr@email.wm.edu>
parent 130a3e10
Pipeline #338 failed with stages
......@@ -34,6 +34,7 @@ Ivan Penkov <ivanpe@google.com>
Jacob Trimble <modmaker@google.com>
Jim Ray <jimray@google.com>
Marco Wang <m.aesophor@gmail.com>
Michael Darr <mdarr@matician.com>
Michael Tanner <michael@tannertaxpro.com>
MiniLight <MiniLightAR@Gmail.com>
Peter Collingbourne <pcc@google.com>
......
......@@ -62,15 +62,17 @@ find_package_handle_standard_args (Unwind REQUIRED_VARS Unwind_INCLUDE_DIR
Unwind_LIBRARY Unwind_PLATFORM_LIBRARY VERSION_VAR Unwind_VERSION)
if (Unwind_FOUND)
add_library (unwind::unwind INTERFACE IMPORTED)
if (NOT TARGET unwind::unwind)
add_library (unwind::unwind INTERFACE IMPORTED)
set_property (TARGET unwind::unwind PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${Unwind_INCLUDE_DIR}
)
set_property (TARGET unwind::unwind PROPERTY
INTERFACE_LINK_LIBRARIES ${Unwind_LIBRARY} ${Unwind_PLATFORM_LIBRARY}
)
set_property (TARGET unwind::unwind PROPERTY
IMPORTED_CONFIGURATIONS RELEASE
)
set_property (TARGET unwind::unwind PROPERTY
INTERFACE_INCLUDE_DIRECTORIES ${Unwind_INCLUDE_DIR}
)
set_property (TARGET unwind::unwind PROPERTY
INTERFACE_LINK_LIBRARIES ${Unwind_LIBRARY} ${Unwind_PLATFORM_LIBRARY}
)
set_property (TARGET unwind::unwind PROPERTY
IMPORTED_CONFIGURATIONS RELEASE
)
endif (NOT TARGET unwind::unwind)
endif (Unwind_FOUND)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment