NVHPC: System include directories not applied properly
target_include_directories
with the SYSTEM
argument does not seem to work with the NVHPC compiler.
The attached gcc.txt
file demonstrates that passing SYSTEM
to target_include_directories
successfully results in -isystem
being emitted; however, in nvhpc.txt
the include directory is prefixed with -I
instead of -isystem
.
The NVHPC compiler supports the -isystem
flag, so the solution should be simply to pass it in the same way for both GCC and NVHPC.
sweemer@tesla-t4-1:~$ nvc++ --help | grep isystem
-isystem<incdir> Add a directory to the include file search path before the standard include directories, and mark it as system include directory
I am using CMake 3.21.3 on Ubuntu 18.04.6 LTS. The source code I used to generate the output files is in isystem_test.tar.gz
.
Edited by Brad King