diff --git a/Doxyfile b/Doxyfile index 2829150..cf2c103 100644 --- a/Doxyfile +++ b/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = rs232 # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.2.0 +PROJECT_NUMBER = 1.3.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/README.md b/README.md index b654d80..5f45c01 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ RS232 ===== -A C C++ library for using rs232 protocole over Linux and Windows. +A C++ library for using rs232 protocole over Linux and Windows. This project was originally a fork of [kranfix/rs232](https://github.com/kranfix/rs232). All of the C cupport was dropped and huge code changes were made to make this a proper C++ library. diff --git a/include/rs232.hpp b/include/rs232.hpp index a9c240d..3654160 100644 --- a/include/rs232.hpp +++ b/include/rs232.hpp @@ -33,6 +33,10 @@ #include #endif +#ifndef RS232_EXPORT_MACRO + #define RS232_EXPORT_MACRO +#endif + namespace sakurajin { #ifdef RS232_UNIX @@ -74,7 +78,7 @@ namespace sakurajin { }; #endif - class RS232{ + class RS232_EXPORT_MACRO RS232{ private: /** * @brief The name of the connected port. diff --git a/meson.build b/meson.build index 0e282e7..c97e581 100644 --- a/meson.build +++ b/meson.build @@ -6,7 +6,7 @@ project( 'cpp_std=c++17', 'c_std=c17', ], - version : '1.2.0', + version : '1.3.0', meson_version : '>= 0.55' ) @@ -15,6 +15,15 @@ project( cc = meson.get_compiler('c') cxx = meson.get_compiler('cpp') +# define the correct export macro on windows +if target_machine.system() == 'windows' + if get_option('buildtype') != 'static' + add_project_arguments('-DRS232_EXPORT_MACRO=__declspec(dllexport)', language: 'cpp') + else + add_project_arguments('-DRS232_EXPORT_MACRO=__declspec(dllimport)', language: 'cpp') + endif +endif + # All the headers required to compile the lib on unix systems unix_c_headers = [ 'termios.h',