Support for SWIG and Node.js

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Support for SWIG and Node.js

Yegor Yefremov
I've seen, that CMake has updated UseSWIG in version 3.8.x. But it doesn't seem to support the following use case:

swig -c++ -javascript -node interface.i src.c

I.e. I can define "-c++" via set_property(SOURCE interface.i PROPERTY CPLUSPLUS ON), but how to specify "-node" or "-jsc" or "-v8"?

Best regards,
Yegor
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Support for SWIG and Node.js

Bruce Jones
I don't have a solution for you, but I agree that this functionality would be incredibly useful!

On Wed, 27 Sep 2017 at 01:39 Yegor Yefremov <[hidden email]> wrote:
I've seen, that CMake has updated UseSWIG in version 3.8.x. But it doesn't seem to support the following use case:

swig -c++ -javascript -node interface.i src.c

I.e. I can define "-c++" via set_property(SOURCE interface.i PROPERTY CPLUSPLUS ON), but how to specify "-node" or "-jsc" or "-v8"?

Best regards,
Yegor
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Support for SWIG and Node.js

Michael Ellery
In reply to this post by Yegor Yefremov

> On Sep 26, 2017, at 10:39 PM, Yegor Yefremov <[hidden email]> wrote:
>
> I've seen, that CMake has updated UseSWIG in version 3.8.x. But it doesn't seem to support the following use case:
>
> swig -c++ -javascript -node interface.i src.c
>
> I.e. I can define "-c++" via set_property(SOURCE interface.i PROPERTY CPLUSPLUS ON), but how to specify "-node" or "-jsc" or "-v8"?
>
> Best regards,
> Yegor
Have you tried setting CMAKE_SWIG_FLAGS  ?

https://gitlab.kitware.com/cmake/cmake/blob/master/Modules/UseSWIG.cmake#L41

-Mike


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Support for SWIG and Node.js

Yegor Yefremov
On 27.09.2017 17:18, Michael Ellery wrote:

>> On Sep 26, 2017, at 10:39 PM, Yegor Yefremov <[hidden email]> wrote:
>>
>> I've seen, that CMake has updated UseSWIG in version 3.8.x. But it doesn't seem to support the following use case:
>>
>> swig -c++ -javascript -node interface.i src.c
>>
>> I.e. I can define "-c++" via set_property(SOURCE interface.i PROPERTY CPLUSPLUS ON), but how to specify "-node" or "-jsc" or "-v8"?
>>
>> Best regards,
>> Yegor
> Have you tried setting CMAKE_SWIG_FLAGS  ?
>
> https://gitlab.kitware.com/cmake/cmake/blob/master/Modules/UseSWIG.cmake#L41
>
> -Mike
>
I think it won't work this way. Because in this case swig can only make a binding cxx file, i.e. I'm not using SWIG_LINK_LIBRARIES. Further steps will be made via npm/node-gyp. That's why I get:

CMake Error: CMake can not determine linker language for target: jsonrisc
CMake Error: Cannot determine link language for target "jsonrisc".

I'll stick for custom command for now.

Thanks.


Yegor


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake