This deepens on build tool you use, I usually use Makefile to build OXC.
In Makefile you need add lines:
SRCS_YAML = ../../lib/yaml-cpp/
SRCS_YAML_CPP = $(wildcard $(SRCS_YAML)src/*.cpp $(SRCS_YAML)src/contrib/*.cpp)
and
$(OBJDIR)yaml/%.o:: $(SRCS_YAML)src/%.cpp
@mkdir -p $(OBJDIR)yaml
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(OBJDIR)yaml/%.o:: $(SRCS_YAML)src/contrib/%.cpp
@mkdir -p $(OBJDIR)yaml
$(CXX) $(CXXFLAGS) -c -o $@ $<
Its shodul placed it like in
https://github.com/Yankes/OpenXcom/blob/OpenXcomExtended/src/Makefile.mingw but this file is for Windows
Proper Makefile for linux is
https://github.com/Yankes/OpenXcom/blob/OpenXcomExtended/src/Makefile.simple but build yaml dynamically from system headers.
You would need add this lines to it and remove yam from `$(shell $(PKG-CONFIG) --libs sdl yaml-cpp)`.
For cmake it will be probably bit harder, I don't know it how properly do it but fast hack would be adding manually new parts to
https://github.com/Yankes/OpenXcom/blob/OpenXcomExtended/src/CMakeLists.txtset ( yaml_src
yaml/SomeYamlFile.cpp
yaml/AnotherYamlFile.cpp
)
You will need probably list all cpp files manually to made it work (similar how rest of oxc is handled). Maybe is possible to use wild char like `*` to skip listing all files but I don't know without some googling.