raise an error if PCH files are stored in different folders

pull/4757/head
Nicolas Schneider 6 years ago committed by Jussi Pakkanen
parent 09739284be
commit 1058430898
  1. 3
      mesonbuild/build.py
  2. 0
      test cases/failing/93 pch source different folder/include/pch.h
  3. 5
      test cases/failing/93 pch source different folder/meson.build
  4. 1
      test cases/failing/93 pch source different folder/prog.c
  5. 0
      test cases/failing/93 pch source different folder/src/pch.c

@ -1089,6 +1089,9 @@ You probably should put it in link_with instead.''')
pchlist = [pchlist[1], pchlist[0]]
else:
raise InvalidArguments('PCH argument %s is of unknown type.' % pchlist[0])
if (os.path.dirname(pchlist[0]) != os.path.dirname(pchlist[1])):
raise InvalidArguments('PCH files must be stored in the same folder.')
elif len(pchlist) > 2:
raise InvalidArguments('PCH definition may have a maximum of 2 files.')
for f in pchlist:

@ -0,0 +1,5 @@
project('pch', 'c')
# It is not allowed to have the PCH implementation in a different
# folder than the header.
exe = executable('prog', 'prog.c',
c_pch : ['include/pch.h', 'src/pch.c'])
Loading…
Cancel
Save