changeset 699:808171f7bfa2

Misc: replace IRCCD_EXPORT with CMake functionality
author David Demelier <markand@malikania.fr>
date Wed, 09 May 2018 20:11:50 +0200
parents ad1ee47165fa
children 91bc29e87399
files CMakeLists.txt cmake/internal/sysconfig.hpp.in libcommon/irccd/string_util.hpp libcommon/irccd/system.hpp
diffstat 4 files changed, 18 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Mon May 07 21:10:12 2018 +0200
+++ b/CMakeLists.txt	Wed May 09 20:11:50 2018 +0200
@@ -58,9 +58,12 @@
 endfunction ()
 
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${irccd_SOURCE_DIR}/cmake/packages)
-set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+set(CMAKE_POSITION_INDEPENDENT_CODE On)
+set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_STANDARD_REQUIRED On)
+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS On)
 
-set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+set_property(GLOBAL PROPERTY USE_FOLDERS On)
 
 include(CMakeParseArguments)
 
--- a/cmake/internal/sysconfig.hpp.in	Mon May 07 21:10:12 2018 +0200
+++ b/cmake/internal/sysconfig.hpp.in	Wed May 09 20:11:50 2018 +0200
@@ -106,24 +106,4 @@
 #cmakedefine HAVE_STD_PUT_TIME
 #cmakedefine HAVE_SYSLOG
 
-/*
- * Export stuff.
- * ------------------------------------------------------------------
- */
-#cmakedefine BUILD_SHARED_LIBS
-
-#if defined(_WIN32)
-#   if defined(BUILD_SHARED_LIBS)
-#       if defined(IRCCD_BUILDING_DLL)
-#           define IRCCD_EXPORT __declspec(dllexport)
-#       else
-#           define IRCCD_EXPORT __declspec(dllimport)
-#       endif
-#   else
-#       define IRCCD_EXPORT
-#   endif
-#else
-#   define IRCCD_EXPORT
-#endif
-
 #endif // !IRCCD_SYSCONFIG_HPP
--- a/libcommon/irccd/string_util.hpp	Mon May 07 21:10:12 2018 +0200
+++ b/libcommon/irccd/string_util.hpp	Wed May 09 20:11:50 2018 +0200
@@ -190,7 +190,7 @@
  *   - <strong>\@{white,black,bold,underline}</strong>: will write white text on
  *     black in both bold and underline.
  */
-IRCCD_EXPORT std::string format(std::string text, const subst& params = {});
+std::string format(std::string text, const subst& params = {});
 
 // }}}
 
@@ -202,7 +202,7 @@
  * \param str the string
  * \return the removed white spaces
  */
-IRCCD_EXPORT std::string strip(std::string str) noexcept;
+std::string strip(std::string str) noexcept;
 
 // }}}
 
@@ -216,7 +216,7 @@
  * \param max max number of split
  * \return a list of string splitted
  */
-IRCCD_EXPORT std::vector<std::string> split(const std::string& list, const std::string& delimiters, int max = -1);
+std::vector<std::string> split(const std::string& list, const std::string& delimiters, int max = -1);
 
 // }}}
 
@@ -297,7 +297,7 @@
  * \return true if is boolean
  * \note this function is case-insensitive
  */
-IRCCD_EXPORT bool is_boolean(std::string value) noexcept;
+bool is_boolean(std::string value) noexcept;
 
 // }}}
 
--- a/libcommon/irccd/system.hpp	Mon May 07 21:10:12 2018 +0200
+++ b/libcommon/irccd/system.hpp	Wed May 09 20:11:50 2018 +0200
@@ -44,28 +44,28 @@
  *
  * \param name the program name
  */
-IRCCD_EXPORT void set_program_name(std::string name) noexcept;
+void set_program_name(std::string name) noexcept;
 
 /**
  * Get the system name.
  *
  * \return the name
  */
-IRCCD_EXPORT std::string name();
+std::string name();
 
 /**
  * Get the system version.
  *
  * \return the version
  */
-IRCCD_EXPORT std::string version();
+std::string version();
 
 /**
  * Get the number of seconds elapsed since the boottime.
  *
  * \return the number of seconds
  */
-IRCCD_EXPORT std::uint64_t uptime();
+std::uint64_t uptime();
 
 /**
  * Get the milliseconds elapsed since the application
@@ -73,21 +73,21 @@
  *
  * \return the milliseconds
  */
-IRCCD_EXPORT std::uint64_t ticks();
+std::uint64_t ticks();
 
 /**
  * Get an environment variable.
  *
  * \return the value or empty string
  */
-IRCCD_EXPORT std::string env(const std::string& var);
+std::string env(const std::string& var);
 
 /**
  * Get home directory usually /home/foo
  *
  * \return the home directory
  */
-IRCCD_EXPORT std::string home();
+std::string home();
 
 #if defined(HAVE_SETUID)
 
@@ -96,7 +96,7 @@
  *
  * \param value the value
  */
-IRCCD_EXPORT void set_uid(const std::string& value);
+void set_uid(const std::string& value);
 
 #endif
 
@@ -107,7 +107,7 @@
  *
  * \param value the value
  */
-IRCCD_EXPORT void set_gid(const std::string& value);
+void set_gid(const std::string& value);
 
 #endif