I'm trying to create a module for zxing-cpp for barcode and QR code reading/writing for Godot 3.5.3 Stable. I originally tried building the library separately and linking it, but I was getting a ton of errors (I believe the error was along the lines of value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease'. Resolving this issue was beyond me.)
I decided I'd just try and get SCons to build it from source with the engine, instead. However, I'm running into a strange problem: The zxing-cpp file structure is as follows:
src/
- A/
-- A.cpp
-- A.h
- B/
-- B.cpp
-- B.h
- src.cpp
- src.h
the sources and headers of the subdirectories A and B in the example above have includes such as #include "src.h". However, SCons is unable to find src.h when compiling those sources. I've added src/ to my CPPPath in my SCsub, but it doesn't seem to recognize it.
Here's what my SCsub file looks like:
Import('env')
Import('env_modules')
env_zxing = env_modules.Clone()
env_zxing.add_source_files(env.modules_sources, "*.cpp")
env_zxing.add_source_files(env.modules_sources, "src/*.cpp")
env_zxing.add_source_files(env.modules_sources, "src/aztec/*.cpp")
env_zxing.add_source_files(env.modules_sources, "src/datamatrix/*.cpp")
env_zxing.add_source_files(env.modules_sources, "src/libzueci/*.cpp")
env_zxing.add_source_files(env.modules_sources, "src/maxicode/*.cpp")
env_zxing.add_source_files(env.modules_sources, "src/oned/*.cpp")
env_zxing.add_source_files(env.modules_sources, "src/pdf417/*.cpp")
env_zxing.add_source_files(env.modules_sources, "src/qrcode/*.cpp")
include_paths = [
"#modules/zxing/",
"#modules/zxing/src/",
"#modules/zxing/src/aztec/",
"#modules/zxing/src/datamatrix/",
"#modules/zxing/src/libzueci/",
"#modules/zxing/src/maxicode/",
"#modules/zxing/src/oned/",
"#modules/zxing/src/pdf417/",
"#modules/zxing/src/qrcode/"
]
env_zxing.Prepend(CPPPath=include_paths)
I've tried just about everything, but short of just adding "../" to the #include definitions to every single file in each and every subdirectory, I can't seem to get SCons to use the headers in the "src/" directory.
Any help would be appreciated!