* PGI C++ PCH enable PGI compilers support precompiled headers for C++ only. The common/13 pch test passes if run manually with no spaces in the build path. However, since Meson run_project_tests.py makes temporary build directories with spaces in each tests, PGI --pch_dir can't handle this and fails. So we skip the test for PGI despite it working for usual case with no-spaces in build dir. Note: it's fine to have spaces in full path for sourcedir, just no spaces in relative path to builddir. * docpull/5743/head
parent
986587067c
commit
1e53f67187
8 changed files with 55 additions and 3 deletions
@ -1,8 +1,14 @@ |
||||
cc = meson.get_compiler('c') |
||||
cc_id = cc.get_id() |
||||
|
||||
if cc_id == 'lcc' |
||||
error('MESON_SKIP_TEST: Elbrus compiler does not support PCH.') |
||||
endif |
||||
|
||||
# PGI compiler only supports PCH for C++ |
||||
if cc_id == 'pgi' |
||||
subdir_done() |
||||
endif |
||||
|
||||
exe = executable('prog', 'prog.c', |
||||
c_pch : 'pch/prog.h') |
||||
|
@ -1,8 +1,11 @@ |
||||
// Note: if using PGI compilers, you will need to add #include "prog.hh"
|
||||
// even though you're using precompiled headers.
|
||||
void func() { |
||||
std::cout << "This is a function that fails to compile if iostream is not included." |
||||
<< std::endl; |
||||
} |
||||
|
||||
int main(int argc, char **argv) { |
||||
func(); |
||||
return 0; |
||||
} |
||||
|
@ -1,9 +1,15 @@ |
||||
cc = meson.get_compiler('c') |
||||
cc_id = cc.get_id() |
||||
|
||||
if cc_id == 'lcc' |
||||
error('MESON_SKIP_TEST: Elbrus compiler does not support PCH.') |
||||
endif |
||||
|
||||
# PGI compiler only supports PCH for C++ |
||||
if cc_id == 'pgi' |
||||
subdir_done() |
||||
endif |
||||
|
||||
exe = executable('prog', 'prog.c', |
||||
include_directories: 'include', |
||||
c_pch : 'pch/prog.h') |
||||
|
Loading…
Reference in new issue