Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/freebsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
fi
mkdir build
cd build
cmake .. -DWITH_SERIAL_BACKEND=ON
cmake .. -DWITH_SERIAL_BACKEND=ON -DLICENSE_CHECK=ON
make


Expand Down
5 changes: 3 additions & 2 deletions CI/azure/build_mingw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ install_pacman_deps() {

build_libiio() {
local build_type="${CMAKE_BUILD_TYPE:-Release}" # default to Release
$CMAKE -G "MinGW Makefiles" -DPYTHON_EXECUTABLE:FILEPATH=$(python -c "import os, sys; print(os.path.dirname(sys.executable) + '\python.exe')") \
$CMAKE -G "MinGW Makefiles" -DPYTHON_EXECUTABLE:FILEPATH=$(python -c "import os, sys; print(os.path.join(os.path.dirname(sys.executable), 'python.exe')") \
-DCMAKE_SYSTEM_PREFIX_PATH="C:" -DCMAKE_BUILD_TYPE="$build_type" -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON \
-DENABLE_IPV6=ON -DWITH_USB_BACKEND=ON -DWITH_SERIAL_BACKEND=ON -DPYTHON_BINDINGS=ON -DCPP_BINDINGS=ON \
-DCSHARP_BINDINGS:BOOL=OFF ..
$CMAKE --build . --config "$build_type"
$CMAKE --build . --verbose --config "$build_type"
$CMAKE -DLICENSE_CHECK=ON ..
}

init_env
Expand Down
2 changes: 1 addition & 1 deletion CI/build_win_msvc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cmake -G "$Env:COMPILER" -DCMAKE_SYSTEM_PREFIX_PATH="C:" `
-DLIBUSB_LIBRARIES="$Env:BUILD_SOURCESDIRECTORY\deps\libusb\$VS_version\MS64\dll\libusb-1.0.lib" -DLIBUSB_INCLUDE_DIR="$Env:BUILD_SOURCESDIRECTORY\deps\libusb\include" `
-DLIBSERIALPORT_LIBRARIES="$Env:BUILD_SOURCESDIRECTORY\deps\libserialport\x64\Release\libserialport.lib" -DLIBSERIALPORT_INCLUDE_DIR="$Env:BUILD_SOURCESDIRECTORY\deps\libserialport" `
-DLIBZSTD_LIBRARIES="$Env:BUILD_SOURCESDIRECTORY\deps\zstd\build\VS2010\bin\x64_Release\libzstd.lib" -DLIBZSTD_INCLUDE_DIR="$Env:BUILD_SOURCESDIRECTORY\deps\zstd\lib" `
-DWITH_EXAMPLES=ON ..
-DWITH_EXAMPLES=ON -DLICENSE_CHECK=ON ..

cmake --build . --config $Env:CMAKE_BUILD_TYPE

Expand Down
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,8 @@ if(NOT TARGET uninstall)
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()

option(LICENSE_CHECK "Print out licenses of files used in binaries" OFF)
Comment thread
rgetz marked this conversation as resolved.
Resolved

string(REPLACE ";" "," LIBIIO_SCAN_BACKENDS "${LIBIIO_SCAN_BACKENDS}")

configure_file(iio-config.h.cmakein ${CMAKE_CURRENT_BINARY_DIR}/iio-config.h @ONLY)
Expand Down Expand Up @@ -804,6 +806,9 @@ toggle_iio_feature("${WITH_DOC}" doc)
toggle_iio_features_for_lists(IIOM_OPTIONS IIOM_FEATURES)
#add binding settings
toggle_iio_features_for_lists(IIOB_OPTIONS IIOB_FEATURES)
list(APPEND IIO_FEATURES_ON ${IIOB_FEATURES_ON})
list(APPEND IIO_FEATURES_OFF ${IIOB_FEATURES_OFF})
toggle_iio_feature("${LICENSE_CHECK}" license_check)

# prepare features lists and print them
string(REPLACE ";" " " IIO_FEATURES_ON "${IIO_FEATURES_ON}")
Expand All @@ -813,3 +818,10 @@ message(STATUS "Features enabled : ${IIO_FEATURES_ON}")
message(STATUS "Features disabled: ${IIO_FEATURES_OFF}")
message(STATUS "Install Path set to '${CMAKE_INSTALL_PREFIX}\', modify with -DCMAKE_INSTALL_PREFIX=/path")
message(STATUS "LOG_LEVEL set to \"${LOG_LEVEL}\"")

if (LICENSE_CHECK)
# Call it from the top-level source directory after all add_subdirectory calls
include(cmake/Utilities.cmake)
spdx_check_all_targets(${CMAKE_SOURCE_DIR})
endif()

26 changes: 24 additions & 2 deletions README_BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,26 @@

## Instructions applicable to Linux, BSD, and Windows configurations

### Install Prerequisites/Dependencies
## License Considerations
libiio includes source components that are released under a mix of open-source licenses, including MIT, GPL, and LGPL. As a result, the license of the **final built binaries** depends on the selected build configuration.

In a typical build on a POSIX-compliant system (such as Linux), libiio produces:
- A shared library licensed under the **GNU Lesser General Public License version 2.1 or later (LGPL-2.1-or-later)**.
- User-space utilities (such as command-line tools) licensed under the **GNU General Public License (GPL)**.

The specific options you enable or disable during configuration can affect which components are included and which license terms apply to the resulting binaries.

Additionally, libiio may link against external system libraries (e.g., `libzstd`, `libxml2`, `libavahi`, etc.) depending on the selected features. These dependencies have their own licensing terms and may further influence the overall license obligations of your build.

For **non-POSIX environments** (such as microcontrollers, Zephyr, FreeRTOS, and other embedded platforms), the project aims to support configurations that include only permissively licensed components. In such cases, the goal is to produce a minimal **MIT-only** licensed library suitable for static linking in constrained or proprietary environments.

To verify the licensing implications of your build, it is **strongly recommended** that you:
- Review your configuration options carefully.
- Enable the license compatibility check by passing `-DLICENSE_CHECK=ON` to CMake during configuration.

This helps ensure that the resulting binaries align with your project's licensing, compliance, and distribution requirements.

### Install Prerequisites/Dependencies
Basic system setup
```shell
analog@precision:~$ sudo apt-get update
Expand Down Expand Up @@ -102,6 +120,10 @@ Cmake Options | Default | Description |
| | | Warning : Print warnings and errors |
| | Info | Info : Print info, warnings and errors |
| | | Debug : Print debug/info/warnings/errors (very verbose) |
|`LICENSE_CHECK` | OFF | Use to print out license info on files used for targets |
| | | This is informative only, as many files are different |
| | | licenses, and this is an easy way to see what is the |
| | | final license of the resulting binary |

Options which affect iiod only. These are only available on Linux.

Expand Down Expand Up @@ -256,4 +278,4 @@ analog@precision:~/libiio/build$ sudo make uninstall
```

### Notes
After enabling and then disabling WITH_LIBTINYIIOD, the previously disabled features will not be automatically restored. To build libiio for a Linux/BSD/Windows configuration, clear the build directory and follow the appropriate setup instructions.
After enabling and then disabling WITH_LIBTINYIIOD, the previously disabled features will not be automatically restored. To build libiio for a Linux/BSD/Windows configuration, clear the build directory and follow the appropriate setup instructions.
8 changes: 5 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ stages:
set -e
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=$(cmakeBuildType) -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DENABLE_PACKAGING=ON -DCPP_BINDINGS=ON -DWITH_DOC=ON -DWITH_SERIAL_BACKEND=ON -DWITH_MAN=ON -DCPACK_SYSTEM_NAME=${ARTIFACTNAME}
make
make VERBOSE=1
cmake .. -DLICENSE_CHECK=ON
make package
make required2tar
displayName: 'Build'
Expand Down Expand Up @@ -306,8 +307,9 @@ stages:
- script: |
set -e
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=$(cmakeBuildType) -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DOSX_PACKAGE=ON -DWITH_EXAMPLES=ON -DWITH_SERIAL_BACKEND=ON
make
cmake .. -DCMAKE_BUILD_TYPE=$(cmakeBuildType) -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DOSX_PACKAGE=ON -DPYTHON_EXECUTABLE:FILEPATH=$(python -c "import os, sys; print(os.path.join(os.path.dirname(sys.executable), 'python'))") -DPYTHON_BINDINGS=ON -DWITH_EXAMPLES=ON -DWITH_SERIAL_BACKEND=ON
make VERBOSE=1
cmake -DLICENSE_CHECK=ON ..
sudo make install
cd ..
displayName: 'Build'
Expand Down
Loading
Loading