-
Notifications
You must be signed in to change notification settings - Fork 697
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: James Choi <[email protected]>
- Loading branch information
Showing
106 changed files
with
1,550 additions
and
112 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
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 | ||
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,108 @@ | ||
ifndef QCONFIG | ||
QCONFIG=qconfig.mk | ||
endif | ||
include $(QCONFIG) | ||
|
||
#where to install vsomeip: | ||
#$(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 | ||
VSOMEIP_INSTALL_ROOT ?= $(INSTALL_ROOT_$(OS)) | ||
|
||
#where to find the vsomeip external dependencies, such as Boost | ||
VSOMEIP_EXTERNAL_DEPS_INSTALL ?= $(USE_ROOT_$(OS)) | ||
|
||
# Get version information from CMakeLists.txt | ||
VSOMEIP_MAJOR_VERSION = $(word 3, $(shell bash -c "grep VSOMEIP_MAJOR_VERSION $(PROJECT_ROOT)/../CMakeLists.txt | head -1 | head -c-2")) | ||
VSOMEIP_MINOR_VERSION = $(word 3, $(shell bash -c "grep VSOMEIP_MINOR_VERSION $(PROJECT_ROOT)/../CMakeLists.txt | head -1 | head -c-2")) | ||
VSOMEIP_PATCH_VERSION = $(word 3, $(shell bash -c "grep VSOMEIP_PATCH_VERSION $(PROJECT_ROOT)/../CMakeLists.txt | head -1 | head -c-2")) | ||
|
||
#choose Release or Debug | ||
CMAKE_BUILD_TYPE ?= Release | ||
|
||
#set the following to TRUE if you want to compile the vsomeip tests. | ||
#If you do, make sure to set GTEST_ROOT to point to the google test library sources | ||
GENERATE_TESTS ?= TRUE | ||
TEST_IP_MASTER ?= XXX.XXX.XXX.XXX | ||
TEST_IP_SLAVE ?= XXX.XXX.XXX.XXX | ||
|
||
#set the following to FALSE if generating .pinfo files is causing problems | ||
GENERATE_PINFO_FILES ?= TRUE | ||
|
||
#override 'all' target to bypass the default QNX build system | ||
ALL_DEPENDENCIES = vsomeip_all | ||
.PHONY: vsomeip_all | ||
|
||
FLAGS += -g -D_QNX_SOURCE | ||
LDFLAGS += -Wl,--build-id=md5 -lang-c++ -lsocket | ||
|
||
CMAKE_ARGS = -DCMAKE_TOOLCHAIN_FILE=$(PROJECT_ROOT)/qnx.nto.toolchain.cmake \ | ||
-DCMAKE_INSTALL_PREFIX=$(VSOMEIP_INSTALL_ROOT)/$(CPUVARDIR)/usr \ | ||
-DCMAKE_CXX_STANDARD=14 \ | ||
-DCMAKE_NO_SYSTEM_FROM_IMPORTED=TRUE \ | ||
-DVSOMEIP_EXTERNAL_DEPS_INSTALL=$(VSOMEIP_EXTERNAL_DEPS_INSTALL) \ | ||
-DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) \ | ||
-DCMAKE_MODULE_PATH=$(PROJECT_ROOT) \ | ||
-DEXTRA_CMAKE_C_FLAGS="$(FLAGS)" \ | ||
-DEXTRA_CMAKE_CXX_FLAGS="$(FLAGS)" \ | ||
-DEXTRA_CMAKE_LINKER_FLAGS="$(LDFLAGS)" \ | ||
-DINSTALL_INCLUDE_DIR=$(VSOMEIP_INSTALL_ROOT)/usr/include \ | ||
-DCPUVARDIR=$(CPUVARDIR) \ | ||
-DGCC_VER=${GCC_VER} \ | ||
-DVSOMEIP_INSTALL_ROUTINGMANAGERD=ON | ||
|
||
ifeq ($(GENERATE_TESTS), TRUE) | ||
CMAKE_ARGS += -DENABLE_SIGNAL_HANDLING=1 \ | ||
-DTEST_IP_MASTER=$(TEST_IP_MASTER) \ | ||
-DTEST_IP_SLAVE=$(TEST_IP_SLAVE) | ||
endif | ||
|
||
MAKE_ARGS ?= -j $(firstword $(JLEVEL) 4) | ||
|
||
define PINFO | ||
endef | ||
PINFO_STATE=Experimental | ||
USEFILE= | ||
|
||
include $(MKFILES_ROOT)/qtargets.mk | ||
|
||
ifneq ($(wildcard $(foreach dir,$(LIBVPATH),$(dir)/libregex.so)),) | ||
LDFLAGS += -lregex | ||
endif | ||
|
||
|
||
ifndef NO_TARGET_OVERRIDE | ||
vsomeip_all: | ||
@mkdir -p build | ||
@cd build && cmake $(CMAKE_ARGS) ../../../../../ | ||
@cd build && make all $(MAKE_ARGS) | ||
@cd build && make build_tests $(MAKE_ARGS) | ||
|
||
install: vsomeip_all | ||
@cd build && make install $(MAKE_ARGS) | ||
@cd build && make build_tests install $(MAKE_ARGS) | ||
|
||
clean iclean spotless: | ||
@rm -fr build | ||
|
||
endif | ||
|
||
#everything down below deals with the generation of the PINFO | ||
#information for shared objects that is used by the QNX build | ||
#infrastructure to embed metadata in the .so files, for example | ||
#data and time, version number, description, etc. Metadata can | ||
#be retrieved on the target by typing 'use -i <path to vsomeip .so file>'. | ||
#this is optional: setting GENERATE_PINFO_FILES to FALSE will disable | ||
#the insertion of metadata in .so files. | ||
ifeq ($(GENERATE_PINFO_FILES), TRUE) | ||
#the following rules are called by the cmake generated makefiles, | ||
#in order to generate the .pinfo files for the shared libraries | ||
%.so.$(VSOMEIP_MAJOR_VERSION).$(VSOMEIP_MINOR_VERSION).$(VSOMEIP_PATCH_VERSION): | ||
$(ADD_PINFO) | ||
$(ADD_USAGE) | ||
|
||
%vsomeipd: | ||
$(ADD_PINFO) | ||
$(ADD_USAGE) | ||
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,8 @@ | ||
LIST=CPU | ||
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,8 @@ | ||
LIST=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,5 @@ | ||
include ../../../common.mk | ||
|
||
CMAKE_ARGS += -DCMAKE_SYSTEM_PROCESSOR=aarch64 | ||
FLAGS += $(VFLAG_le) $(CCVFLAG_le) | ||
LDFLAGS += $(VFLAG_le) $(LDVFLAG_le) |
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=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,3 @@ | ||
include ../../../common.mk | ||
|
||
CMAKE_ARGS += -DCMAKE_SYSTEM_PROCESSOR=x86_64 |
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,43 @@ | ||
if("$ENV{QNX_HOST}" STREQUAL "") | ||
message(FATAL_ERROR "QNX_HOST environment variable not found. Please set the variable to your host's build tools") | ||
endif() | ||
if("$ENV{QNX_TARGET}" STREQUAL "") | ||
message(FATAL_ERROR "QNX_TARGET environment variable not found. Please set the variable to the qnx target location") | ||
endif() | ||
|
||
if(CMAKE_HOST_WIN32) | ||
set(HOST_EXECUTABLE_SUFFIX ".exe") | ||
#convert windows paths to cmake paths | ||
file(TO_CMAKE_PATH "$ENV{QNX_HOST}" QNX_HOST) | ||
file(TO_CMAKE_PATH "$ENV{QNX_TARGET}" QNX_TARGET) | ||
else() | ||
set(QNX_HOST "$ENV{QNX_HOST}") | ||
set(QNX_TARGET "$ENV{QNX_TARGET}") | ||
endif() | ||
|
||
message(STATUS "using QNX_HOST ${QNX_HOST}") | ||
message(STATUS "using QNX_TARGET ${QNX_TARGET}") | ||
|
||
set(CMAKE_SYSTEM_NAME QNX) | ||
set(CMAKE_C_COMPILER ${QNX_HOST}/usr/bin/qcc) | ||
set(CMAKE_CXX_COMPILER ${QNX_HOST}/usr/bin/qcc) | ||
set(CMAKE_AR "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-ar${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "archiver") | ||
set(CMAKE_RANLIB "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-ranlib${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "ranlib") | ||
|
||
if ("${GCC_VER}" STREQUAL "") | ||
set(GCC_VERSION "" CACHE STRING "gcc_ver") | ||
else() | ||
set(GCC_VERSION "${GCC_VER}," CACHE STRING "gcc_ver") | ||
endif() | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -V${GCC_VERSION}gcc_nto${CMAKE_SYSTEM_PROCESSOR} ${EXTRA_CMAKE_C_FLAGS}" CACHE STRING "c_flags") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -V${GCC_VERSION}gcc_nto${CMAKE_SYSTEM_PROCESSOR} ${EXTRA_CMAKE_CXX_FLAGS}" CACHE STRING "cxx_flags") | ||
|
||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EXTRA_CMAKE_LINKER_FLAGS}" CACHE STRING "exe_linker_flags") | ||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${EXTRA_CMAKE_LINKER_FLAGS}" CACHE STRING "so_linker_flags") | ||
|
||
set(CMAKE_FIND_ROOT_PATH ${VSOMEIP_EXTERNAL_DEPS_INSTALL};${VSOMEIP_EXTERNAL_DEPS_INSTALL}/${CPUVARDIR};${QNX_TARGET};${QNX_TARGET}/${CPUVARDIR}) | ||
|
||
set(CMAKE_SKIP_RPATH TRUE CACHE BOOL "If set, runtime paths are not added when using shared libraries.") | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) |
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
Oops, something went wrong.