|
1 | | -# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 1 | +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
2 | 2 | # SPDX-License-Identifier: Apache-2.0 |
3 | 3 | # |
4 | 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -57,6 +57,13 @@ option(EXPOSE_CODE "Expose in resulting binaries parts of our code" ${DEFAULT_EX |
57 | 57 | option(WARNINGS_AS_ERRORS "Treat compilation warnings as errors" OFF) |
58 | 58 | cmake_dependent_option(ENABLE_TEGRA "Enable tegra support" ON "PLATFORM_IS_ARM64" OFF) |
59 | 59 | cmake_dependent_option(ENABLE_COMPAT_OLD_GLIBC "Generates binaries that work with old distros, with old glibc" ON "NOT ENABLE_TEGRA" OFF) |
| 60 | +cmake_dependent_option(ENABLE_QNX "Enable QNX support" OFF "PLATFORM_IS_ARM64" OFF) |
| 61 | + |
| 62 | +if(ENABLE_QNX) |
| 63 | + set(PLATFORM_IS_QNX ON) |
| 64 | +else() |
| 65 | + set(PLATFORM_IS_QNX OFF) |
| 66 | +endif() |
60 | 67 |
|
61 | 68 | # Needed to get cuda version |
62 | 69 | find_package(CUDAToolkit REQUIRED) |
@@ -94,11 +101,19 @@ function(setup_dso target version) |
94 | 101 | # Put each function and it's data into separate linker sections |
95 | 102 | target_compile_options(${target} PRIVATE -ffunction-sections -fdata-sections) |
96 | 103 |
|
97 | | - # Link with static C/C++ libs ========================== |
98 | | - target_link_libraries(${target} PRIVATE |
99 | | - -static-libstdc++ |
100 | | - -static-libgcc |
101 | | - ) |
| 104 | + if(PLATFORM_IS_QNX) |
| 105 | + # For QNX, explicitly link libc++ as the C++ Standard Library and Math library |
| 106 | + target_link_libraries(${target} PRIVATE |
| 107 | + c++ |
| 108 | + m |
| 109 | + ) |
| 110 | + else() |
| 111 | + # Link with static C/C++ libs |
| 112 | + target_link_libraries(${target} PRIVATE |
| 113 | + -static-libstdc++ |
| 114 | + -static-libgcc |
| 115 | + ) |
| 116 | + endif() |
102 | 117 |
|
103 | 118 | # Configure symbol visibility --------------------------------------------- |
104 | 119 | set_target_properties(${target} PROPERTIES VISIBILITY_INLINES_HIDDEN on |
|
0 commit comments