File tree Expand file tree Collapse file tree 9 files changed +34
-10
lines changed
HelloWorldExample/generated_code
RPCExample/generated_code Expand file tree Collapse file tree 9 files changed +34
-10
lines changed Original file line number Diff line number Diff line change 8888 - name : Get minimum supported version of CMake
8989 uses : eProsima/eProsima-CI/external/get-cmake@v0
9090 with :
91- cmakeVersion : ' 3.22.6 '
91+ cmakeVersion : ' 3.24.4 '
9292
9393 - name : Install apt dependencies
9494 uses : eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
@@ -188,7 +188,7 @@ jobs:
188188 - name : Get minimum supported version of CMake
189189 uses : eProsima/eProsima-CI/external/get-cmake@v0
190190 with :
191- cmakeVersion : ' 3.22.6 '
191+ cmakeVersion : ' 3.24.4 '
192192
193193 - name : Install apt packages
194194 uses : eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
Original file line number Diff line number Diff line change 9191 - name : Get minimum supported version of CMake
9292 uses : eProsima/eProsima-CI/external/get-cmake@v0
9393 with :
94- cmakeVersion : ' 3.22.6 '
94+ cmakeVersion : ' 3.24.4 '
9595
9696 - name : Install OpenSSL
9797 uses : eProsima/eprosima-CI/windows/install_openssl@v0
@@ -210,7 +210,7 @@ jobs:
210210 - name : Get minimum supported version of CMake
211211 uses : eProsima/eProsima-CI/external/get-cmake@v0
212212 with :
213- cmakeVersion : ' 3.22.6 '
213+ cmakeVersion : ' 3.24.4 '
214214
215215 - name : Install OpenSSL
216216 uses : eProsima/eprosima-CI/windows/install_openssl@v0
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- cmake_minimum_required (VERSION 3.22 )
15+ cmake_minimum_required (VERSION 3.24 )
1616
1717# SWIG: use standard target name.
1818if (POLICY CMP0078)
@@ -53,7 +53,13 @@ endif()
5353include (${SWIG_USE_FILE} )
5454set (CMAKE_SWIG_FLAGS "" )
5555
56- find_package (Python3 COMPONENTS Interpreter Development REQUIRED )
56+ option (USE_PYTHON_STABLE_ABI "Generate Fast DDS python against Python Stable ABI" OFF )
57+
58+ if (USE_PYTHON_STABLE_ABI)
59+ find_package (Python3 COMPONENTS Interpreter Development.SABIModule REQUIRED )
60+ else ()
61+ find_package (Python3 COMPONENTS Interpreter Development REQUIRED )
62+ endif ()
5763
5864find_package (fastcdr REQUIRED )
5965find_package (fastdds 3 REQUIRED )
Original file line number Diff line number Diff line change 11{
22 "name": "fastdds_python",
33 "type": "cmake",
4- "build- dependencies": ["fastdds"]
4+ "dependencies": ["fastdds"]
55}
Original file line number Diff line number Diff line change @@ -59,10 +59,19 @@ endif()
5959
6060if (MSVC OR MSVC_IDE )
6161 target_compile_options (${PROJECT_NAME} PRIVATE /bigobj )
62+
63+ if (USE_PYTHON_STABLE_ABI)
64+ target_compile_definitions (${PROJECT_NAME}
65+ PRIVATE
66+ NOMINMAX
67+ Py_LIMITED_API=0x03040000
68+ )
69+ endif ()
70+
6271endif ()
6372
6473target_link_libraries (${PROJECT_NAME}
65- Python3::Module
74+ $< IF :$< BOOL : ${USE_PYTHON_STABLE_ABI} >, Python3 ::SABIModule , Python3 :: Module >
6675 fastcdr
6776 fastdds
6877 )
Original file line number Diff line number Diff line change 2424 std::string err_msg (" In method '$symname': " );
2525
2626 PyObject* exc_str = PyObject_GetAttrString (exc, " __name__" );
27- err_msg += PyUnicode_AsUTF8 (exc_str);
27+ PyObject* unicode = PyUnicode_AsUTF8String (exc_str);
28+ err_msg += PyBytes_AsString (unicode);
29+ Py_XDECREF (unicode);
2830 Py_XDECREF (exc_str);
2931
3032 if (val != NULL )
3133 {
3234 PyObject* val_str = PyObject_Str (val);
35+ PyObject* unicode2 = PyUnicode_AsUTF8String (val_str);
3336 err_msg += " : " ;
34- err_msg += PyUnicode_AsUTF8 (val_str);
37+ err_msg += PyBytes_AsString (unicode);
38+ Py_XDECREF (unicode2);
3539 Py_XDECREF (val_str);
3640 }
3741
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ include(${SWIG_USE_FILE})
7979set (CMAKE_SWIG_FLAGS "" )
8080
8181find_package (Python3 COMPONENTS Interpreter Development REQUIRED )
82+
8283set (PYTHON_INCLUDE_PATH ${Python3_INCLUDE_DIRS} )
8384set (PYTHON_EXECUTABLE ${Python3_EXECUTABLE} )
8485set (PYTHON_LIBRARIES ${Python3_LIBRARIES} )
@@ -191,6 +192,7 @@ include(${SWIG_USE_FILE})
191192set (CMAKE_SWIG_FLAGS "" )
192193
193194find_package (Python3 COMPONENTS Interpreter Development REQUIRED )
195+
194196set (PYTHON_INCLUDE_PATH ${Python3_INCLUDE_DIRS} )
195197set (PYTHON_EXECUTABLE ${Python3_EXECUTABLE} )
196198set (PYTHON_LIBRARIES ${Python3_LIBRARIES} )
@@ -304,6 +306,7 @@ include(${SWIG_USE_FILE})
304306set (CMAKE_SWIG_FLAGS "" )
305307
306308find_package (Python3 COMPONENTS Interpreter Development REQUIRED )
309+
307310set (PYTHON_INCLUDE_PATH ${Python3_INCLUDE_DIRS} )
308311set (PYTHON_EXECUTABLE ${Python3_EXECUTABLE} )
309312set (PYTHON_LIBRARIES ${Python3_LIBRARIES} )
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ include(${SWIG_USE_FILE})
7979set (CMAKE_SWIG_FLAGS "" )
8080
8181find_package (Python3 COMPONENTS Interpreter Development REQUIRED )
82+
8283set (PYTHON_INCLUDE_PATH ${Python3_INCLUDE_DIRS} )
8384set (PYTHON_EXECUTABLE ${Python3_EXECUTABLE} )
8485set (PYTHON_LIBRARIES ${Python3_LIBRARIES} )
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ include(${SWIG_USE_FILE})
7474set (CMAKE_SWIG_FLAGS "" )
7575
7676find_package (Python3 COMPONENTS Interpreter Development REQUIRED )
77+
7778set (PYTHON_INCLUDE_PATH ${Python3_INCLUDE_DIRS} )
7879set (PYTHON_EXECUTABLE ${Python3_EXECUTABLE} )
7980set (PYTHON_LIBRARIES ${Python3_LIBRARIES} )
You can’t perform that action at this time.
0 commit comments