-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dlt: Adaptation for QNX build system with SDP 7.x (#609)
* switch to CMAKE_INSTALL_SYSCONFDIR support cmake --install command's --prefix option and CMAKE_INSTALL_PREFIX variable Signed-off-by: Marcin Sochacki <[email protected]> * add WITH_DLT_INSTALLED_TESTS CMake Option When ON, unit test binaries and all relevant files will be installed along with the application binaries. This allows for unit test execution of the cross-compiled code. Signed-off-by: Marcin Sochacki <[email protected]> * add qnx folder with QNX makefiles, fix compilation issues Signed-off-by: Marcin Sochacki <[email protected]> * disable building unit tests + correct typo Signed-off-by: Marcin Sochacki <[email protected]> --------- Signed-off-by: Marcin Sochacki <[email protected]>
- Loading branch information
1 parent
efd8c16
commit 723e90e
Showing
17 changed files
with
208 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# QNX Build Files | ||
build/nto-aarch64-le/* | ||
build/nto-x86_64-o/* | ||
!build/nto-aarch64-le/Makefile | ||
!build/nto-x86_64-o/Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Compile the port for QNX | ||
|
||
**NOTE**: QNX ports are only supported from a Linux host operating system | ||
|
||
- Setup your QNX SDP environment | ||
- From the project root folder, type: | ||
``` | ||
git submodule update --init | ||
make -C qnx/build install JLEVEL=4 [INSTALL_ROOT_nto=PATH_TO_YOUR_STAGING_AREA USE_INSTALL_ROOT=true] | ||
``` | ||
|
||
There are several CMAKE variables set for the QNX build as recommended by the dlt-daemon project maintainers: | ||
* WITH_DLT_QNX_SYSTEM=ON | ||
* WITH_DLT_CXX11_EXT=ON | ||
* DLT_IPC=UNIX_SOCKET | ||
* WITH_DLT_ADAPTOR=ON | ||
* WITH_DLT_USE_IPv6=OFF | ||
* WITH_LIB_SHORT_VERSION=ON | ||
|
||
If you want to customize dlt-daemon features via CMAKE variables, you have to edit *qnx\build\common.mk* file and modify **CMAKE_ARGS** variable. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
LIST=OS CPU VARIANT | ||
ifndef QRECURSE | ||
QRECURSE=recurse.mk | ||
ifdef QCONFIG | ||
QRDIR=$(dir $(QCONFIG)) | ||
endif | ||
endif | ||
include $(QRDIR)$(QRECURSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
ifndef QCONFIG | ||
QCONFIG=qconfig.mk | ||
endif | ||
include $(QCONFIG) | ||
|
||
include $(MKFILES_ROOT)/qmacros.mk | ||
|
||
NAME=dlt-daemon | ||
|
||
DIST_BASE=$(PRODUCT_ROOT)/../ | ||
|
||
#$(INSTALL_ROOT_$(OS)) is pointing to $QNX_TARGET | ||
#by default, unless it was manually re-routed to | ||
#a staging area by setting both INSTALL_ROOT_nto | ||
#and USE_INSTALL_ROOT | ||
INSTALL_ROOT ?= $(INSTALL_ROOT_$(OS)) | ||
|
||
#A prefix path to use **on the target**. This is | ||
#different from INSTALL_ROOT, which refers to a | ||
#installation destination **on the host machine**. | ||
#This prefix path may be exposed to the source code, | ||
#the linker, or package discovery config files (.pc, | ||
#CMake config modules, etc.). Default is /usr/local | ||
PREFIX ?= /usr/local | ||
|
||
#choose Release or Debug | ||
CMAKE_BUILD_TYPE ?= Release | ||
|
||
#override 'all' target to bypass the default QNX build system | ||
ALL_DEPENDENCIES = dlt-daemon_all | ||
.PHONY: dlt-daemon_all install check clean | ||
|
||
CFLAGS += $(FLAGS) | ||
LDFLAGS += -Wl,--build-id=md5 -Wl,--allow-shlib-undefined | ||
|
||
include $(MKFILES_ROOT)/qtargets.mk | ||
|
||
#Search paths for all of CMake's find_* functions -- | ||
#headers, libraries, etc. | ||
# | ||
#$(QNX_TARGET): for architecture-agnostic files shipped with SDP (e.g. headers) | ||
#$(QNX_TARGET)/$(CPUVARDIR): for architecture-specific files in SDP | ||
#$(INSTALL_ROOT)/$(CPUVARDIR): any packages that may have been installed in the staging area | ||
CMAKE_FIND_ROOT_PATH := $(QNX_TARGET);$(QNX_TARGET)/$(CPUVARDIR);$(INSTALL_ROOT)/$(CPUVARDIR) | ||
|
||
#Path to CMake modules; These are CMake files installed by other packages | ||
#for downstreams to discover them automatically. We support discovering | ||
#CMake-based packages from inside SDP or in the staging area. | ||
#Note that CMake modules can automatically detect the prefix they are | ||
#installed in. | ||
CMAKE_MODULE_PATH := $(QNX_TARGET)/$(CPUVARDIR)/$(PREFIX)/lib/cmake;$(INSTALL_ROOT)/$(CPUVARDIR)/$(PREFIX)/lib/cmake | ||
|
||
#Headers from INSTALL_ROOT need to be made available by default | ||
#because CMake and pkg-config do not necessary add it automatically | ||
#if the include path is "default" | ||
CFLAGS += -I$(INSTALL_ROOT)/$(CPUVARDIR)/$(PREFIX)/include | ||
|
||
|
||
CMAKE_ARGS = -DCMAKE_TOOLCHAIN_FILE=$(PROJECT_ROOT)/qnx.nto.toolchain.cmake \ | ||
-DCMAKE_SYSTEM_PROCESSOR=$(CPUVARDIR) \ | ||
-DCMAKE_C_FLAGS="$(CFLAGS)" \ | ||
-DCMAKE_CXX_FLAGS="$(CFLAGS)" \ | ||
-DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS)" \ | ||
-DCMAKE_CXX_COMPILER_TARGET=gcc_nto$(CPUVARDIR) \ | ||
-DCMAKE_C_COMPILER_TARGET=gcc_nto$(CPUVARDIR) \ | ||
-DCMAKE_INSTALL_PREFIX="$(PREFIX)" \ | ||
-DCMAKE_STAGING_PREFIX="$(INSTALL_ROOT)/$(CPUVARDIR)/$(PREFIX)" \ | ||
-DCMAKE_MODULE_PATH="$(CMAKE_MODULE_PATH)" \ | ||
-DCMAKE_FIND_ROOT_PATH="$(CMAKE_FIND_ROOT_PATH)" \ | ||
-DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) \ | ||
-DWITH_DLT_INSTALLED_TESTS=OFF \ | ||
-DWITH_DLT_UNIT_TESTS=OFF \ | ||
-DWITH_EXTENDED_FILTERING=ON \ | ||
-DWITH_DLT_QNX_SYSTEM=ON \ | ||
-DWITH_DLT_CXX11_EXT=ON \ | ||
-DDLT_IPC=UNIX_SOCKET \ | ||
-DWITH_DLT_ADAPTOR=ON \ | ||
-DWITH_DLT_USE_IPv6=OFF \ | ||
-DWITH_LIB_SHORT_VERSION=ON | ||
|
||
MAKE_ARGS ?= -j $(firstword $(JLEVEL) 1) | ||
|
||
ifndef NO_TARGET_OVERRIDE | ||
dlt-daemon_all: | ||
@mkdir -p build | ||
cd build && cmake $(CMAKE_ARGS) $(DIST_BASE) | ||
@cd build && make VERBOSE=1 all $(MAKE_ARGS) | ||
|
||
install check: dlt-daemon_all | ||
@echo Installing... | ||
@cd build && make VERBOSE=1 install $(MAKE_ARGS) | ||
@echo Done. | ||
|
||
clean iclean spotless: | ||
rm -rf build | ||
|
||
uninstall: | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include ../common.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include ../common.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
set(QNX TRUE) | ||
set(CMAKE_SYSTEM_NAME QNX) | ||
set(CMAKE_C_COMPILER qcc) | ||
set(CMAKE_CXX_COMPILER q++) | ||
set(CMAKE_CXX_STANDARD 14) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters