Skip to content

Commit

Permalink
Updated TAS Client API to version 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
TasGitHub-IFX committed May 16, 2024
1 parent 227337d commit 3a93b6f
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 18 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ cmake_minimum_required(VERSION "${MIN_VER_CMAKE}" FATAL_ERROR)
# Project definition
# -----------------------------------------------------------------------------
project(tas_client_api
VERSION 1.0.0
VERSION 1.0.1
DESCRIPTION "Infineon's Tool Access Socket (TAS) Client API"
HOMEPAGE_URL "https://www.infineon.com/DAS"
HOMEPAGE_URL "https://github.com/Infineon/tas_client_api"
LANGUAGES CXX
)
set(TAS_CLIENT_COPYRIGHT "(c) Infineon Technologies AG 2023")
set(TAS_CLIENT_COPYRIGHT "(c) Infineon Technologies AG 2024")

# -----------------------------------------------------------------------------
# Break in case of popular CMake configuration mistakes
Expand Down
26 changes: 20 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

This readme file gives an overview how to build and run the code.

## Important branches to know
develop --> Development is done continuously on this branch
master --> Fully tested released source code

## Prerequisite for building locally
This project uses [conan](https://conan.io) as dependency manager and consequently CMake as the build environment.
All required packages and build tools are retrieved from the [ConanCenter](https://conan.io/center). See conanfile.py
Expand All @@ -18,6 +14,9 @@ for the list of dependencies. Therefore, to build this project you will need:
- Target compiler: msvc, gcc, etc.
- [Doxygen](https://www.doxygen.nl/), if you want to build the API reference documentation

### Prerequisite for building the python wrapper
Python packages: setuptools, wheel, virtualenv

### Conan
If not already installed, install conan:
```
Expand All @@ -31,9 +30,13 @@ conan profile detect
The generated profile can be then found under *\<home_dir\>/.conan2/profiles*. The default configuration is Release.
More information about conan profiles can be found here https://docs.conan.io/2.0/reference/config_files/profiles.html.
Edit the default conan profile with your favorite text editor so that the **C++17 standard** is used.
```
compiler.cppstd=17
```
Note: make sure your compiler supports C++17.

## Building
First generate the build environment by invoking conan from the root of this repository:
First generate the build environment by invoking conan **from the root of this repository**:
```
conan install .
conan install . -s build_type=Debug --build=missing
Expand Down Expand Up @@ -106,4 +109,15 @@ The project is configured in way that the binaries can be installed to a specifi
```
cmake --install build --prefix=install
```
where build is the build directory, and prefix options defines the root install / export folder.
where build is the build directory, and prefix options defines the root install / export folder.

## Python wrapper
Building the python wrapper using the above steps requires -o python=True conan option when invoking the conan install command.

If you want to use a specific Python version or you have multiple version installed you can tell CMake which one to use
by modifying the following CMake file: python\CMakeLists.txt before executing the above commands.
```
set(Python3_ROOT_DIR "<system path to python root>")
```

The generated python wheel will be located under: build\python\dist
1 change: 0 additions & 1 deletion apps/tas_rw_api_demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ if (MSVC)
target_compile_options(${EXE_NAME} PRIVATE
/W3
/MP
/std:c++20
"$<$<CONFIG:Release>:"
"/O2"
">"
Expand Down
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def system_requirements(self):

def requirements(self):
# define dependencies
self.requires("pybind11/2.10.4")
self.requires("pybind11/2.12.0")

def build_requirements(self):
# define build tools dependencies
Expand Down
20 changes: 15 additions & 5 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@ if (NOT TAS_CLIENT_API_BUILD_PYTHON)
return()
endif()

# Based on pybind11 this should be after python.
# However, with Python debug libs installed there are issues.
# Pybind11 issue: https://github.com/pybind/pybind11/issues/3403
# Non-compliant fix is to swap these two.
find_package(pybind11 CONFIG)
# Uncomment and spcify the root of Python installation if specific version should be used, otherwise the system default
# is selected
if (WIN32)
#set(Python3_ROOT_DIR "C:\\Program Files\\Python311")
elseif (UNIX)
#set(Python3_ROOT_DIR "/usr/bin/python3.11")
endif()

# Look for python executable
find_package(Python3 COMPONENTS Interpreter Development)
# Based on pybind11 this should be after find_package(Python3). However, with Python debug libs installed there is an issues.
find_package(pybind11 CONFIG)

# Solution for an open issue due to installed python debug libs: https://github.com/pybind/pybind11/issues/3403
set_target_properties(Python3::Module PROPERTIES
MAP_IMPORTED_CONFIG_DEBUG ";RELEASE")

if (NOT pybind11_FOUND)
message(FATAL_ERROR "pybind11 not found ${pybind11_FOUND}. Dependecies managed by conan, run 'conan install .' first")
Expand Down
1 change: 0 additions & 1 deletion src/tas_client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ if (MSVC)
target_compile_options(${LIB_NAME} PRIVATE
/W3
/MP
/std:c++20
"$<$<CONFIG:Release>:"
"/O2"
">"
Expand Down
1 change: 0 additions & 1 deletion src/tas_socket/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ if (MSVC)
target_compile_options(${LIB_NAME} PRIVATE
/W3
/MP
/std:c++20
"$<$<CONFIG:Release>:"
"/O2"
">"
Expand Down

0 comments on commit 3a93b6f

Please sign in to comment.