Compiler kind (always gcc for now) and version (4.8/4.9/5/6/7) is now always included in llvm package name. Additionally if `--no-cxx11-abi` flag is passed to premake then package name will end wiht "-no-cxx11".
Prebuilt LLVM binaries package for CI needs renaming to `llvm-9bde5f-linux-x64-gcc-4.8-Release.tar.xz`.
Also debug text cleaning moved to CodeGenerator.cs and is done when printing bindings. New lines are not stripped out, instead each line is prepended with "// DEBUG: ". Now debug info is properly formatted, easy to read and full.
Includes setup was moved to ParserOptions.cs and is used just like `SetupMSVC()` and `SetupXcode()`. Native compiler is queried for it's type and version. Correct include paths are set up in cases where system has multiple compilers installed as well.
Tests for cases where class name matches translation unit name.
Tests for cases where global constants/functions from different translation units would end up in the value type.
In some cases `Delegates` namespace could be attached to a namespace which is not wrapped and as a result of that `Delegates` namespace was also not generated in wrapper code resulting in a wrapper build errors. Change adds extra logic which tries to find the correct library namespace if more than one namespace is present.
This change prevents premake from inserting /usr/lib64 search path on linux. GCC does not need this path specified compiler automatically knows where to look for system libs. Insertion of this path causes issues system has clang/llvm libs installed. Build would link to system libraries instead of custom required by CppSharp.
Also this patch revealed that linking to `pthread`, `z` and `tinfo` libraries on linux is not necessary and disabling them in LLVM build config works. Linking to these libs was removed. As you probably have guessed in the past CppSharp would throw `DllNotFoundException` due to missing symbols because it linked to system LLVM libs, not custom in-tree LLVM build.
GCC version is checked, if version is 4.8 or lower then cxx11 ABI is disabled. Added new `--no-cxx11-abi` option. It explicitly disables cxx11 ABI even on new compilers. This option is also taken into account when building LLVM.
Link `pthread` and `z` on linux as well. Link `tinfo` if `/usr/lib/libtinfo.so` file exists. This is required because despite explicitly disabling these libs in LLVM build config they still somehow get pulled in on some systems. `pthread` and `z` are standard components of every linux distribution therefore linking them unconditionally is OK. `tinfo` may not exist on some systems therefore it's existence is checked first. With this patch finally builds produced on Archlinux no longer result in `DllNotFoundException`.
`get_llvm_build_dir()` returns directory `<llvm_dir>/build`. It is incorrect when using non-packaged LLVM build, because LLVM is built into `'deps/llvm/'..get_llvm_package_name()`. This change fixes issue where using unpackaged LLVM build resulted in `error: ‘StrictFP’ is not a member of ‘llvm::Attribute’`.
These libs are not used by current official CppSharp binary distributions of LLVM, however building LLVM locally will pick these libs up and link to them if they are installed on local system. Since premake does not link to any of those libs linking to local LLVM build will cause `DllNotFoundException` due to missing symbols.