Skip to content

Commit

Permalink
updating to version 1.3.0 and adding an export macro
Browse files Browse the repository at this point in the history
This new version adds an export macro. This allows for compatibility with msvc.
  • Loading branch information
noah1510 committed Dec 6, 2022
1 parent e2d1ee2 commit 6994a50
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
6 changes: 5 additions & 1 deletion include/rs232.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
#include <windows.h>
#endif

#ifndef RS232_EXPORT_MACRO
#define RS232_EXPORT_MACRO
#endif

namespace sakurajin {

#ifdef RS232_UNIX
Expand Down Expand Up @@ -74,7 +78,7 @@ namespace sakurajin {
};
#endif

class RS232{
class RS232_EXPORT_MACRO RS232{
private:
/**
* @brief The name of the connected port.
Expand Down
11 changes: 10 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(
'cpp_std=c++17',
'c_std=c17',
],
version : '1.2.0',
version : '1.3.0',
meson_version : '>= 0.55'

)
Expand All @@ -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',
Expand Down

0 comments on commit 6994a50

Please sign in to comment.