I am using the following content to include headers to my project using .dir-locals.el
((c++-mode .
((flycheck-clang-language-standard . "c++14")
(flycheck-clang-include-path
"/Users/user/Documents/project_name/source"
"/Users/user/Documents/project_name/source/library/include")
)))
But, I do not want to explicit tell the path when it is located on my computer.
I was trying to use (concat (file-name-directory (or load-file-name buffer-file-name)) "library/include")
for .../source/library/include and just (file-name-directory (or load-file-name buffer-file-name)
for .../source. Since .dir-locals.el is located in /Users/user/Documents/project_name/source
However when I replace the part with its respective instructions I got
Error while checking syntax automatically: (error "Value (\"/Users/user/Documents/project_name/source" (eval concat (file-name-directory (or load-file-name buffer-file-name)) \"library/include\") of flycheck-clang-include-path for option \"-I\" is not a list of strings")
I tried to use it with eval but did not work, How can I accomplish my goal?
EDIT: I test using eval
as db48x suggested as the following:
((c++-mode .
((flycheck-clang-language-standard . "c++14")
(eval .
(setq flycheck-clang-include-path
'("/Users/user/Documents/project_name/source"
"/Users/user/Documents/project_name/source/library/include"))
)
)
))
That worked fine, but when adding replacing the second path with (concat (file-name-directory (or load-file-name buffer-file-name)) "library/include")
got that it is not a list of string.