Please find attached patch for osmocom-sdr
1- Allows compilation on MSVC by conditionally adding __attribute(format tags based on the compiler
2- Allows builders to use Glew when required, making a GlewInit call when USING_GLEW is defined. If that is not defined, there are no changes.
Geof
Hi,
Thanks for the patches. Comments below.
1- Allows compilation on MSVC by conditionally adding __attribute(format tags based on the compiler
I merged an equivalent patch, it'll be pushed whenever I push my next series of update for fosphor.
2- Allows builders to use Glew when required, making a GlewInit call when USING_GLEW is defined. If that is not defined, there are no changes.
Any code in lib/ shouldn't have to care about doing this. It expects that all the required GL setup has been done prior to calling it. Any required setup must be done in the GR C++ part
Also using a magic 'USING_GLEW' that must somehow be setup manually is not acceptable. Need some CMake logic to detect when this is required and automatically set it up.
Cheers,
Sylvain
Any code in lib/ shouldn't have to care about doing this.
Any required setup must be done in the GR C++ part
Do you mean in xxx_sink_c_impl, or are you thinking that GR would do it in it's initial GUI setup?
Also using a magic 'USING_GLEW' that must somehow be setup manually is
not acceptable. Need some CMake logic to detect when this is required and
automatically set it up.
Sure. I don't disagree, but I'm not sure what other configurations would require Glew, so since I couldn't vouch for anything but Win10-64/MSVC, I left it as a manual option that can then be specified on the CMake command line (which is what my build scripts are doing now). If you can point in to what configurations overall would need this, then happy to submit a new change.
Geof
On Sat, Apr 23, 2016 at 9:28 PM, Sylvain Munaut 246tnt@gmail.com wrote:
Hi,
Thanks for the patches. Comments below.
1- Allows compilation on MSVC by conditionally adding __attribute(format tags based on the compiler
I merged an equivalent patch, it'll be pushed whenever I push my next series of update for fosphor.
2- Allows builders to use Glew when required, making a GlewInit call when USING_GLEW is defined. If that is not defined, there are no changes.
Any code in lib/ shouldn't have to care about doing this. It expects that all the required GL setup has been done prior to calling it. Any required setup must be done in the GR C++ part
Also using a magic 'USING_GLEW' that must somehow be setup manually is not acceptable. Need some CMake logic to detect when this is required and automatically set it up.
Cheers,
Sylvain
Hi,
Do you mean in xxx_sink_c_impl, or are you thinking that GR would do it in it's initial GUI setup?
In the xxx_sink_c_impl. Although since this is common this should probably be in the base_sink, most likely just after the glctx_init() call
Also using a magic 'USING_GLEW' that must somehow be setup manually is not acceptable. Need some CMake logic to detect when this is required and automatically set it up.
Sure. I don't disagree, but I'm not sure what other configurations would require Glew, so since I couldn't vouch for anything but Win10-64/MSVC, I left it as a manual option that can then be specified on the CMake command line (which is what my build scripts are doing now). If you can point in to what configurations overall would need this, then happy to submit a new change.
I don't think this is compiler specific so probably anything on windows would require it.
I found out someone else tried to build gr-fosphor with MSVC a while back but he never to upstream :
https://github.com/ariovistus/gr-fosphor/search?utf8=%E2%9C%93&q=glew
You can see there the GLEW things he had to do ... not sure if they're required.
Cheers,
Sylvain
New patch attached.
GLEW detection will be somewhat spotty I suspect, the basic FindGLEW module built into CMake doesn't really cover it so I added some coverage to a custom one and added it to the cmake/modules subdir. It was good enough for mine, and users can manually specify if they need to.
I haven't seen that any of the other changes ariovistus made were necessary to get gr-fosphor going, so I didn't include them. Some are needed for earlier compiler versions, but not MSVC 2015.
On Sun, Apr 24, 2016 at 1:52 AM, Sylvain Munaut 246tnt@gmail.com wrote:
Hi,
Do you mean in xxx_sink_c_impl, or are you thinking that GR would do it
in
it's initial GUI setup?
In the xxx_sink_c_impl. Although since this is common this should probably be in the base_sink, most likely just after the glctx_init() call
Also using a magic 'USING_GLEW' that must somehow be setup manually is not acceptable. Need some CMake logic to detect when this is required
and
automatically set it up.
Sure. I don't disagree, but I'm not sure what other configurations would require Glew, so since I couldn't vouch for anything but Win10-64/MSVC, I left it as a manual option that can then be specified on the CMake
command
line (which is what my build scripts are doing now). If you can point
in to
what configurations overall would need this, then happy to submit a new change.
I don't think this is compiler specific so probably anything on windows would require it.
I found out someone else tried to build gr-fosphor with MSVC a while back but he never to upstream :
https://github.com/ariovistus/gr-fosphor/search?utf8=%E2%9C%93&q=glew
You can see there the GLEW things he had to do ... not sure if they're required.
Cheers,
Sylvain
Hi Geof,
Sorry, took me some time.
I pushed a 'next' branch on the git http://git.osmocom.org/gr-fosphor/log/?h=next
Can you give this a shot and tell me if it works / what still fails ?
Cheers,
Sylvain