Open hehenihao opened 2 years ago
Can you provide qnx_aarch64.cmake and the error message?
Thank you in advance.
test "$BASH_SOURCE" = "" && echo "This script only can be run from bash" && return SCRIPT_SOURCE=$BASH_SOURCE test "$SCRIPT_SOURCE" = "$0" && echo "Script is being run, should be sourced" && exit 1
HOST_OS=$(uname -s) SCRIPT_DIR=$(dirname "${SCRIPT_SOURCE}") QNX_BASE=$(cd "${SCRIPT_DIR}"; pwd) case "$HOST_OS" in Linux) QNX_HOST=$QNX_BASE/host/linux/x86_64 ;; Darwin) QNX_HOST=$QNX_BASE/host/darwin/x86_64 ;; *) QNX_HOST=$QNX_BASE/host/win64/x86_64 ;; esac
QNX_TARGET=$QNX_BASE/target/qnx7 QNX_CONFIGURATION=$HOME/.qnx MAKEFLAGS=-I$QNX_BASE/target/qnx7/usr/include PATH=$QNX_HOST/usr/bin:$QNX_CONFIGURATION/bin:$QNX_BASE/jre/bin:$PATH
export QNX_TARGET QNX_HOST QNX_CONFIGURATION MAKEFLAGS PATH unset PYTHONPATH
qnx_aarch64.cmake
as the following:set(QNX_HOST $ENV{QNX_HOST}) set(QNX_TARGET $ENV{QNX_TARGET}) set(PROJECTENV_LIB $ENV{PROJECTENV_LIB})
SET(CMAKE_SYSTEM_NAME QNX) SET(CMAKE_SYSTEM_PROCESSOR aarch64) SET(CMAKE_SYSTEM_VERSION 1) SET(arch gcc_ntoaarch64le) SET(ntoarch aarch64) SET(QNX_PROCESSOR aarch64)
SET(CMAKE_C_COMPILER qcc) SET(CMAKE_C_COMPILER_TARGET ${arch})
SET(CMAKE_CXX_COMPILER qcc -lang-c++) SET(CMAKE_CXX_COMPILER_TARGET ${arch})
SET(CMAKE_ASM_COMPILER qcc -V${arch}) SET(CMAKE_ASM_DEFINE_FLAG "-Wa,--defsym,")
SET(CMAKE_CUDA_COMPILER "${PROJECTENV_LIB}/cuda/cuda-safe-10.2/bin/nvcc") SET(CMAKE_CUDA_FLAGS "--target-directory aarch64-qnx") SET(CUDAToolkit_ROOT "${PROJECTENV_LIB}/cuda/cuda-safe-10.2") SET(CMAKE_CUDA_HOST_COMPILER "ntoaarch64-gcc")
SET(CMAKE_RANLIB ${QNX_HOST}/usr/bin/nto${ntoarch}-ranlib CACHE PATH "QNX ranlib program" FORCE) SET(CMAKE_AR ${QNX_HOST}/usr/bin/nto${ntoarch}-ar CACHE PATH "QNX qr Program" FORCE)
set(QNX_ARCH "aarch64le") set(NV_PLATFORM_MATHLIB "m") set(QNX_KERNEL_VERSION "7.0.0") set(QNX_COMPILER_VERSION "5.4.0") set(QNX_TOOLS_VARIANT "aarch64-unknown-nto-qnx${QNX_KERNEL_VERSION}")
set(NV_PLATFORM_SDK_INC "${PROJECTENV_LIB}/pdkLib/include") set(NV_PLATFORM_SDK_LIB_DIR "${PROJECTENV_LIB}/pdkLib/lib-target")
set(NV_BSP_INC "${PROJECTENV_LIB}/nvidia-bsp/usr/include") set(NV_BSP_LIB_DIR ${PROJECTENV_LIB}/nvidia-bsp/${QNX_ARCH}/usr/lib ${PROJECTENV_LIB}/nvidia-bsp/${QNX_ARCH}/lib)
set(PROJECT_USR_INC "${PROJECTENV_LIB}/usrLib/include") set(PROJECT_USR_LIB_DIR "${PROJECTENV_LIB}/usrLib/lib")
set(PROJECT_AUTO_SAFETY_INC "${PROJECTENV_LIB}/auto-safety/safetysw_common")
set(NV_COMMON_PLATFORM_CFLAGS "-g \ -O2 \ -fomit-frame-pointer \ -fstack-protector-strong \ -Wall")
set(NV_COMMON_PLATFORM_CXXFLAGS "${NV_COMMON_PLATFORM_CFLAGS} \ -isystem ${QNX_HOST}/usr/lib/gcc/${QNX_TOOLS_VARIANT}/${QNX_COMPILER_VERSION}/include \ -isystem ${QNX_TARGET}/usr/include/c++/v1 \ -isystem ${QNX_TARGET}/usr/include/c++/${QNX_COMPILER_VERSION}/${QNX_TOOLS_VARIANT} \ -isystem ${QNX_TARGET}/usr/include \ -I ${NV_PLATFORM_SDK_INC} \ -I ${NV_BSP_INC} \ -I ${PROJECT_USR_INC} \ -I ${PROJECT_AUTO_SAFETY_INC} \ -I /home/sunzhijin/work/fast_dds_src/install/include \ -L /home/sunzhijin/work/fast_dds_src/install/lib \ -L${NV_PLATFORM_SDK_LIB_DIR} \ -Wl,-rpath-link=${NV_PLATFORM_SDK_LIB_DIR} \ -L${PROJECT_USR_LIB_DIR} \ -Wl,-rpath-link=${PROJECT_USR_LIB_DIR} \ -L${PROJECTENV_LIB}/nvidia-bsp/${QNX_ARCH}/usr/lib \ -Wl,-rpath-link=${PROJECTENV_LIB}/nvidia-bsp/${QNX_ARCH}/usr/lib") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${NV_COMMON_PLATFORM_CXXFLAGS} -D_FILE_OFFSET_BITS=64 -D_QNX_SOURCE -D_POSIX_C_SOURCE=200112L -Wp,-Uunix -Wp,-Uunix -Wp,-U__unix -fexceptions -frtti -fPIC -fpermissive")
set(NV_COMMON_PLATFORM_C_FLAGS "${NV_COMMON_PLATFORM_CFLAGS} \ -isystem ${QNX_HOST}/usr/lib/gcc/${QNX_TOOLS_VARIANT}/${QNX_COMPILER_VERSION}/include \ -isystem ${QNX_TARGET}/usr/include \ -isystem ${NV_PLATFORM_SDK_INC} \ -isystem ${NV_BSP_INC} \ -isystem ${PROJECT_USR_INC} \ -I ${PROJECT_AUTO_SAFETY_INC} \ -I /home/sunzhijin/work/fast_dds_src/install/include \ -L /home/sunzhijin/work/fast_dds_src/install/lib \ -L${NV_PLATFORM_SDK_LIB_DIR} \ -Wl,-rpath-link=${NV_PLATFORM_SDK_LIB_DIR} \ -L${PROJECT_USR_LIB_DIR} \ -Wl,-rpath-link=${PROJECT_USR_LIB_DIR} \ -L${PROJECTENV_LIB}/nvidia-bsp/${QNX_ARCH}/usr/lib \ -Wl,-rpath-link=${PROJECTENV_LIB}/nvidia-bsp/${QNX_ARCH}/usr/lib") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NV_COMMON_PLATFORM_C_FLAGS} -D_FILE_OFFSET_BITS=64 -D_QNX_SOURCE -D_POSIX_C_SOURCE=200112L -Wp,-Uunix -Wp,-Uunix -Wp,-U__unix ")
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
[ 25%] Built target gtest
[ 37%] Building CXX object googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o
In file included from /googletest/googlemock/include/gmock/gmock-actions.h:145:0,
from /googletest/googlemock/include/gmock/gmock.h:56,
from /googletest/googlemock/src/gmock-all.cc:39:
/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h: In static member function 'static testing::internal::StlContainerView<Element [N]>::const_reference testing::internal::StlContainerView<Element [N]>::ConstReference(const Element (&)[N])':
/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:364:53: warning: there are no arguments to 'RelationToSourceReference' that depend on a template parameter, so a declaration of 'RelationToSourceReference' must be available [-fpermissive]
return type(array, N, RelationToSourceReference());
^
/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h: In static member function 'static testing::internal::StlContainerView<Element [N]>::type testing::internal::StlContainerView<Element [N]>::Copy(const Element (&)[N])':
/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:367:48: warning: there are no arguments to 'RelationToSourceCopy' that depend on a template parameter, so a declaration of 'RelationToSourceCopy' must be available [-fpermissive]
return type(array, N, RelationToSourceCopy());
^
/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h: In static member function 'static testing::internal::StlContainerView<std::1::tuple<T1, T2> >::const_reference testing::internal::StlContainerView<std::1::tuple<T1, T2> >::ConstReference(const std::1::tuple<T1, T2>&)':
/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:385:43: warning: there are no arguments to 'RelationToSourceReference' that depend on a template parameter, so a declaration of 'RelationToSourceReference' must be available [-fpermissive]
RelationToSourceReference());
^
/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h: In static member function 'static testing::internal::StlContainerView<std::1::tuple<T1, T2> >::type testing::internal::StlContainerView<std::1::tuple<T1, T2> >::Copy(const std::1::tuple<T1, T2>&)':
/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:388:78: warning: there are no arguments to 'RelationToSourceCopy' that depend on a template parameter, so a declaration of 'RelationToSourceCopy' must be available [-fpermissive]
return type(std::get<0>(array), std::get<1>(array), RelationToSourceCopy());
^
/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h: At global scope:
/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:416:37: error: 'IndexSequence' has not been declared
auto ApplyImpl(F&& f, Tuple&& args, IndexSequence
Hi I met the same problem. Is the problem resolved? THX!
I dont think there is community support for building GMock for QNX Target yet like there is for GTest for QNX Target. Do you know if anyone has forked the googletest repo and updated GMock code to be compatible with QNX? Else we probably could look at what has been done for GMock for Linux as a starting point to QNX.
Hello, has this problem been solved? Can we cross-compile GTest and run it on QNX OS? I want to do software integration tests this way.
Describe the bug
I want to build a library using on the QNX 7.0, and i can build a one with cmake option
-DBUILD_GMOCK=OFF
,but fail with-DBUILD_GMOCK=ON
Steps to reproduce the bug
cmake -DCMAKE_TOOLCHAIN_FILE=../qnx_aarch64.cmake -DCMAKE_INSTALL_PREFIX=../install -DBUILD_GMOCK=ON -DCMAKE_SYSTEM_NAME=QNX ..
Does the bug persist in the most recent commit?
yes
What operating system and version are you using?
QNX 7.0
What compiler and version are you using?
QCC 5.4.0
What build system are you using?
cmake version 3.22.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).