mlaurent added a comment.

  Add in toplevel:
  if(BUILD_TESTING)
  
    add_definitions(-DBUILD_TESTING)
  
  endif(BUILD_TESTING)
  + 
  create a folderplugin_private_export.h as
  #ifndef KSIEVEUIPRIVATE_EXPORT_H
  #define KSIEVEUIPRIVATE_EXPORT_H
  
  #include "ksieveui_export.h"
  
  /* Classes which are exported only for unit tests */
  #ifdef BUILD_TESTING
  
  1. ifndef FOLDERPLUGIN_TESTS_EXPORT
  2. define FOLDERPLUGIN_TESTS_EXPORT FOLDERPLUGIN_EXPORT
  3. endif
  
  #else /* not compiling tests */
  
  define FOLDERPLUGIN_TESTS_EXPORT
  ================================
  
  #endif
  
  #endif
  
  > we avoid to export symbol when we don't build test => distro doesn't 
generate lib with unnecessary exported symbol.
  
=====================================================================================================================

INLINE COMMENTS

> CMakeLists.txt:39
> +generate_export_header(folderplugin BASE_NAME folderplugin)
> +add_subdirectory(tests)

Use 
if(BUILD_TESTING)

  add_subdirectory(tests)

endif()

it's avoid to build tests when distro builds it.

REPOSITORY
  R119 Plasma Desktop

REVISION DETAIL
  https://phabricator.kde.org/D8447

To: amantia, #plasma, ervin, hein, mlaurent, aacid, dvratil, franckarrecot, 
renatoo, olivierjg
Cc: plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, 
abetts, sebas, apol, mart

Reply via email to