I developed a plugin using the SketchUp 2018 SDK. The plugin actually uses the Ruby API to interact with the open model but it also uses the SDK to export SKP files. So the end result after compiling is a .so or .bundle Ruby C Extension that calls various functions that are part of the SketchUp SDK.
Now I want to add compatibility for SketchUp 2017. Unfortunately, my plugin is currently utilizing some SDK functions that were only added in the SU 2018 version. That’s OK, the functions aren’t critical but I’d still like to use them for SU2018+.
In order to support SU2017, is the proper way to build a separate .so file (and create a new Visual Studio configuration) that uses pre-processor directives to compile different code based on whether the configuration is set to support SU2017 or not?
I see that the SDK has a method ‘SUGetAPIVersion’ that can probably tell me which SU version is currently running, but I expect I’ll get load errors if I compile my .so that has any references to future functions that don’t yet exist in the SDK for SU2017.
Ideally, I would be able to support both SU2017 and SU2018+ using the same .so file. Is this even possible if the code includes references to SU2018-only functions?
Lastly, do I need to use the SU2017 SDK .lib files when building for 2017 or can I keep using 2018? In my initial tests, building with the 2018 .lib files did not cause any noticeable errors. If you think I should be using the SU2017 SDK files to build, can someone please post a link to download them?
I hope this all makes sense. Thanks!