From 5b3f3178ae241dc37fe2fb221bde0847408e05a7 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Mon, 4 Feb 2019 09:55:22 -0800 Subject: [PATCH] feat(src/CMakeLists): copy static library to bin directory --- src/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b3392f5a9e..78c86cd7da 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -435,6 +435,13 @@ else() endif() add_library(leanstatic ${LEAN_LIBRARY_TYPE} ${LEAN_OBJS}) target_link_libraries(leanstatic ${EXTRA_LIBS}) + +ADD_CUSTOM_TARGET(bin_lib ALL + COMMAND "${CMAKE_COMMAND}" -E make_directory "${LEAN_SOURCE_DIR}/../bin" + COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_BINARY_DIR}/libleanstatic*" "${LEAN_SOURCE_DIR}/../bin" + DEPENDS leanstatic +) + # The DLL (shared library) is not being generated correctly when we use cross-compilation (i.e., generate the Windows DLL using Linux). # For some strange reason, it contains a copy of pthread_equal. # Remark: this problem does not happen when we generate the DLL using msys2 on Windows.