Follow instructions here first and build the Onnx runtime library: https://onnxruntime.ai/docs/build/inferencing.html
There is also ways to customise the build, like pruning the operators and making a minimal build: https://onnxruntime.ai/docs/build/custom.html