* Use flags from CMake's variables (initialized from environment variables)
including build type specific variables
* Consider LDFLAGS as well; there's actually linking going on¹
¹Otherwise Go's build system wouldn't run into this error
```
# github.com/DataDog/zstd
/usr/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: $WORK/b259/_x008.o:entropy_common.c:(.text+0xaa): undefined reference to `__memcpy_chk'
/usr/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: $WORK/b259/_x033.o:zstd_v01.c:(.text+0x1b84): undefined reference to `__memcpy_chk'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
```
which is caused by LDFLAGS being inconsistent with CFLAGS.
* Pass C/C++ flags from CMake to CGo
* Allow overriding flags passed via "-ldflags"
* Add default GOFLAGS and add CMake variable to override GOFLAGS
* `-trimpath`: Prevent embedding full paths
* `-modcacherw`: Ensure that go modules creates a write-able path
* `-mod=readonly`: Ensure the module files are not updated in any go actions
* Can not use BUNDLED_TARGETS because syncthinginternal is only an
imported target
* Use INSTALL_INTERFACE generator expression to specify path of
libsyncthinginternal.a for installation (imported target can not
be exported apparently)
* This allows running C++ GUI code (as provided by this
repository) and Syncthing itself in the same process.
* It basically seems to work. I can now run a Syncthing
instance within the interactive C++ shell 'cling' :-)
* Syncthing and its assets are built within the usual
CMake build process but disabled by default because still
experimental. To enable the build, add '-DNO_LIBSYNCTHING=OFF'
to CMake arguments.
* The Syncthing checkout with customized exports lives
in the Git submodule under
'libsyncthing/go/src/github.com/syncthing/syncthing'.