forked from mesonbuild/meson
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PGI: cpp_pch precompiled headers functionality
* 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. * doc
- Loading branch information
Showing
8 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') |