The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / libwebsockets / 0001-cmake-disable-shared-library-build-when-BUILD_SHARED.patch
1 From 045b035bd9ebbd45f40dda36b143ede869eb5f16 Mon Sep 17 00:00:00 2001
2 From: Sagaert Johan <sagaert.johan@skynet.be>
3 Date: Fri, 31 Oct 2014 12:25:48 +0100
4 Subject: [PATCH 2/2] cmake: disable shared library build when
5  BUILD_SHARED_LIBS is off
6
7 Original patch from Samuel Martin, reworked by Sagaert Johan when
8 updating libwebsockets.
9
10 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
11 Signed-off-by: Sagaert Johan <sagaert.johan@skynet.be>
12 [yann.morin.1998@free.fr: further fix after the version bumped]
13 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
14 ---
15  CMakeLists.txt | 17 ++++++++++++-----
16  1 file changed, 12 insertions(+), 5 deletions(-)
17
18 diff --git a/CMakeLists.txt b/CMakeLists.txt
19 index 7978845..89853ce 100644
20 --- a/CMakeLists.txt
21 +++ b/CMakeLists.txt
22 @@ -372,14 +372,19 @@ source_group("Sources"          FILES ${SOURCES})
23  #
24  # Create the lib.
25  #
26 +set(_libs_websockets websockets)
27  add_library(websockets STATIC
28                         ${HDR_PRIVATE}
29                         ${HDR_PUBLIC}
30                         ${SOURCES})
31 +
32 +if(BUILD_SHARED_LIBS)
33 +list(APPEND _libs_websockets websockets_shared)
34  add_library(websockets_shared SHARED
35                         ${HDR_PRIVATE}
36                         ${HDR_PUBLIC}
37                         ${SOURCES})
38 +endif()
39  
40  if (WIN32)
41         # On Windows libs have the same file ending (.lib)
42 @@ -400,15 +405,17 @@ endif(WIN32)
43  
44  # We want the shared lib to be named "libwebsockets"
45  # not "libwebsocket_shared".
46 +if(BUILD_SHARED_LIBS)
47  set_target_properties(websockets_shared
48 -               PROPERTIES 
49 +               PROPERTIES
50                 OUTPUT_NAME websockets)
51 +endif()
52  
53  # Set the so version of the lib.
54  # Equivalent to LDFLAGS=-version-info x:x:x
55  if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
56 -       foreach(lib websockets websockets_shared)
57 -               set_target_properties(${lib} 
58 +       foreach(lib ${_libs_websockets})
59 +               set_target_properties(${lib}
60                         PROPERTIES
61                         SOVERSION ${SOVERSION})
62         endforeach()
63 @@ -460,7 +467,7 @@ if (NOT LWS_WITHOUT_EXTENSIONS)
64         endif()
65  
66         # Make sure ZLib is compiled before the libs.
67 -       foreach (lib websockets websockets_shared)
68 +       foreach (lib ${_libs_websockets})
69                 add_dependencies(${lib} ZLIB)
70         endforeach()
71  
72 @@ -524,7 +531,7 @@ if (UNIX)
73  endif()
74  
75  # Setup the linking for all libs.
76 -foreach (lib websockets websockets_shared)
77 +foreach (lib ${_libs_websockets})
78         target_link_libraries(${lib} ${LIB_LIST})
79  endforeach()
80  
81 @@ -793,7 +800,7 @@
82  set(LWS_INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files")
83  
84  # Export targets (This is used for other CMake projects to easily find the libraries and include files).
85 -export(TARGETS websockets websockets_shared
86 +export(TARGETS ${_libs_websockets}
87          FILE "${PROJECT_BINARY_DIR}/LibwebsocketsTargets.cmake")
88  export(PACKAGE libwebsockets)
89  
90 @@ -829,7 +835,7 @@
91                  ${PROJECT_BINARY_DIR}/LibwebsocketsConfigVersion.cmake 
92                  @ONLY)
93  
94 -set_target_properties(websockets websockets_shared 
95 +set_target_properties(${_libs_websockets}
96                                         PROPERTIES PUBLIC_HEADER "${HDR_PUBLIC}")
97  
98  #
99 @@ -837,7 +843,7 @@
100  #
101  
102  # Install libs and headers.
103 -install(TARGETS websockets websockets_shared
104 +install(TARGETS ${_libs_websockets}
105                 EXPORT LibwebsocketsTargets
106                 LIBRARY DESTINATION "${LWS_INSTALL_LIB_DIR}${LIB_SUFFIX}" COMPONENT libraries
107                 ARCHIVE DESTINATION "${LWS_INSTALL_LIB_DIR}${LIB_SUFFIX}" COMPONENT libraries