0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-26 08:01:51 +08:00

Merge pull request #164 from channgo2203/develop

Adding QNX cmake toolchains
This commit is contained in:
Sergey Yagovtsev 2024-09-20 19:29:55 +03:00 committed by GitHub
commit 09a958806a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,8 @@
# Processor specification, possible values: x86_64, armv7le, aarach64, ...
set(CMAKE_SYSTEM_PROCESSOR aarch64)
# Specify arch to be aarch64le
set(arch gcc_ntoaarch64le)
set(ARCH_NAME aarch64le)
# Command settings for QNX
include(${CMAKE_CURRENT_LIST_DIR}/qnx.cmake)

View File

@ -0,0 +1,8 @@
# Processor specification, possible values: x86_64, armv7le, aarach64, ...
set(CMAKE_SYSTEM_PROCESSOR armv7)
# Specify arch to be armv7le
set(arch gcc_ntoarmv7le)
set(ARCH_NAME armle-v7)
# Command settings for QNX
include(${CMAKE_CURRENT_LIST_DIR}/qnx.cmake)

View File

@ -0,0 +1,8 @@
# Processor specification, possible values: x86_64, armv7le, aarach64, ...
set(CMAKE_SYSTEM_PROCESSOR x86_64)
# Specify arch to be x86_64
set(arch gcc_ntox86_64)
set(ARCH_NAME x86_64)
# Command settings for QNX
include(${CMAKE_CURRENT_LIST_DIR}/qnx.cmake)

View File

@ -0,0 +1,33 @@
# Cross compilation for QNX
set(CMAKE_SYSTEM_NAME QNX)
set(QNX YES)
# Suppose you have already set QNX_HOST and QNX_TARGET Add compiler and linker
# flags -std=gnu++14 is needed because QNX header files only cover GNU and POSIX
set(CMAKE_CXX_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} -lang-c++ -V${arch} -std=gnu++14")
# Add definitions command for diffent platforms So we can use macro definition
# "#ifdef PLATFORM_QNX" in source code
set(PLATFORM_QNX ON)
add_definitions(-DPLATFORM_QNX)
# Build crossguid library for qnx
set(GUID_LIBUUID ON)
add_definitions(-DGUID_LIBUUID)
# Upstream settings
set(CMAKE_C_COMPILER qcc)
set(CMAKE_C_COMPILER_TARGET ${arch})
set(CMAKE_CXX_COMPILER q++)
set(CMAKE_CXX_COMPILER_TARGET ${arch})
# Set the path to the qnx host include and lib
include_directories($ENV{QNX_HOST}/usr/include)
link_directories($ENV{QNX_HOST}/usr/lib)
# Set the path to the qnx target include and lib
include_directories($ENV{QNX_TARGET}/usr/include)
link_directories($ENV{QNX_TARGET}/usr/lib)
include_directories($ENV{QNX_TARGET}/${ARCH_NAME}/usr/include)
link_directories($ENV{QNX_TARGET}/${ARCH_NAME}/lib)
link_directories($ENV{QNX_TARGET}/${ARCH_NAME}/usr/lib)