Made the dlib shared library build dependent on the static library build. This

is because some build systems seem to mess up the parallel build of these two
things and sometimes rebuild and potentially clobber object files during the
parallel build.  I haven't seen this result in a problem, but the race
condition does seem to exist in some build systems.  So this should force the
two top level targets to be build sequentially rather than in parallel, thus
avoiding any possible race condition.
This commit is contained in:
Davis King 2016-12-26 08:56:40 -05:00
parent 7bf01102d5
commit b93b6f36a4

View File

@ -185,6 +185,7 @@ if (NOT TARGET dlib)
add_library(dlib STATIC ${source_files} ) add_library(dlib STATIC ${source_files} )
if (UNIX AND NOT DLIB_IN_PROJECT_BUILD) if (UNIX AND NOT DLIB_IN_PROJECT_BUILD)
add_library(dlib_shared SHARED ${source_files} ) add_library(dlib_shared SHARED ${source_files} )
add_dependencies(dlib_shared dlib)
endif() endif()
else() else()
@ -631,8 +632,10 @@ if (NOT TARGET dlib)
if (UNIX AND NOT DLIB_IN_PROJECT_BUILD) if (UNIX AND NOT DLIB_IN_PROJECT_BUILD)
if (DLIB_USE_CUDA) if (DLIB_USE_CUDA)
cuda_add_library(dlib_shared SHARED ${source_files} ) cuda_add_library(dlib_shared SHARED ${source_files} )
add_dependencies(dlib_shared dlib)
else() else()
add_library(dlib_shared SHARED ${source_files} ) add_library(dlib_shared SHARED ${source_files} )
add_dependencies(dlib_shared dlib)
endif() endif()
target_link_libraries(dlib_shared ${dlib_needed_libraries} ) target_link_libraries(dlib_shared ${dlib_needed_libraries} )
endif() endif()