3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-07 18:05:21 +00:00

Fix racing MSVC CMake build. The `libz3` target must have a different

OUTPUT_NAME than the ``shell`` target to avoid conflicting file names.
This commit is contained in:
Dan Liew 2016-02-29 23:06:35 +00:00
parent 246a105006
commit ce54f6d957

View file

@ -90,7 +90,6 @@ endif()
add_library(libz3 ${lib_type} ${object_files})
# FIXME: Set "VERSION" and "SOVERSION" properly
set_target_properties(libz3 PROPERTIES
OUTPUT_NAME z3
# FIXME: Should we be using ${Z3_VERSION} here?
# VERSION: Sets up symlinks, does it do anything else?
VERSION ${Z3_VERSION}
@ -98,6 +97,16 @@ set_target_properties(libz3 PROPERTIES
# and should be incremented everytime the API changes
SOVERSION ${Z3_VERSION})
if (NOT MSVC)
# On UNIX like platforms if we don't change the OUTPUT_NAME
# the library gets a name like ``liblibz3.so`` so we change it
# here. We don't do a rename with MSVC because we get file naming
# conflicts (the z3 executable also has this OUTPUT_NAME) with
# ``.ilk``, ``.pdb``, ``.lib`` and ``.exp`` files sharing the same
# prefix.
set_target_properties(libz3 PROPERTIES OUTPUT_NAME z3)
endif()
# Using INTERFACE means that targets that try link against libz3 will
# automatically link against the libs in Z3_DEPENDENT_LIBS
target_link_libraries(libz3 INTERFACE ${Z3_DEPENDENT_LIBS})