Using system include directory causes build errors
- Dominant language
- C++
- Stars
- 228
- Forks
- 77
- PR merge metrics
- No merged PRs in 30d
Description
If some libraries in `third_party/` are already installed in the system, current Amber build adopts the system library instead of the one in `third_party/` and it can lead to build errors.
The following log shows arguments for `src/amberscript/parser_test.cc`:
```
[6/7] /usr/bin/c++ -DAMBER_ENGINE_DAWN=0 -DAMBER_ENGINE_VULKAN=1 -I../../include
-I../../ -I../../third_party/spirv-tools/include -isystem /usr/local/include -isystem
../../third_party/googletest/googletest/include -I../../third_party/shaderc/libshaderc/include
-I../../third_party/glslang/SPIRV/.. -I../../third_party/glslang/SPIRV/../External
-I../../third_party/glslang/glslang/.. -I../../third_party/spirv-headers/include -isystem
../../third_party/googletest/googletest -std=c++11
-Wall -Werror -Wextra -Wno-unknown-pragmas -Wpedantic -pedantic-errors -g
-Wno-global-constructors -fno-exceptions -fno-rtti -pthread -MD -MT
src/CMakeFiles/amber_unittests.dir/amberscript/parser_test.cc.o -MF
src/CMakeFiles/amber_unittests.dir/amberscript/parser_test.cc.o.d -o
src/CMakeFiles/amber_unittests.dir/amberscript/parser_test.cc.o -c ../../src/amberscript/parser_test.cc
```
`-isystem /usr/local/include` is shown before `-isystem ../../third_party/googletest/googletest/include`.
If `gtest/gtest.h` exists in `/usr/local/include`, it will be used instead of `third_party/googletest/googletest/include`.
However, the build will try to link it with the one in `third_party/` and it can lead to unreferenced symbols.
Contributor guide
Assessment
This issue has not been assessed yet.