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: Michael Darr <mdarr@matician.com> * Alphabetize contributor list * Fix inconsistent CMake style Signed-off-by: Michael Darr <medarr@email.wm.edu>
This commit is contained in:
parent
130a3e10de
commit
195d416e3b
@ -34,6 +34,7 @@ Ivan Penkov <ivanpe@google.com>
|
|||||||
Jacob Trimble <modmaker@google.com>
|
Jacob Trimble <modmaker@google.com>
|
||||||
Jim Ray <jimray@google.com>
|
Jim Ray <jimray@google.com>
|
||||||
Marco Wang <m.aesophor@gmail.com>
|
Marco Wang <m.aesophor@gmail.com>
|
||||||
|
Michael Darr <mdarr@matician.com>
|
||||||
Michael Tanner <michael@tannertaxpro.com>
|
Michael Tanner <michael@tannertaxpro.com>
|
||||||
MiniLight <MiniLightAR@Gmail.com>
|
MiniLight <MiniLightAR@Gmail.com>
|
||||||
Peter Collingbourne <pcc@google.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)
|
Unwind_LIBRARY Unwind_PLATFORM_LIBRARY VERSION_VAR Unwind_VERSION)
|
||||||
|
|
||||||
if (Unwind_FOUND)
|
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
|
set_property (TARGET unwind::unwind PROPERTY
|
||||||
INTERFACE_INCLUDE_DIRECTORIES ${Unwind_INCLUDE_DIR}
|
INTERFACE_INCLUDE_DIRECTORIES ${Unwind_INCLUDE_DIR}
|
||||||
)
|
)
|
||||||
set_property (TARGET unwind::unwind PROPERTY
|
set_property (TARGET unwind::unwind PROPERTY
|
||||||
INTERFACE_LINK_LIBRARIES ${Unwind_LIBRARY} ${Unwind_PLATFORM_LIBRARY}
|
INTERFACE_LINK_LIBRARIES ${Unwind_LIBRARY} ${Unwind_PLATFORM_LIBRARY}
|
||||||
)
|
)
|
||||||
set_property (TARGET unwind::unwind PROPERTY
|
set_property (TARGET unwind::unwind PROPERTY
|
||||||
IMPORTED_CONFIGURATIONS RELEASE
|
IMPORTED_CONFIGURATIONS RELEASE
|
||||||
)
|
)
|
||||||
|
endif (NOT TARGET unwind::unwind)
|
||||||
endif (Unwind_FOUND)
|
endif (Unwind_FOUND)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user