Coder Social home page Coder Social logo

Comments (7)

LanderlYoung avatar LanderlYoung commented on May 21, 2024

结论,同一次构建是不支持多个backend的。
这也是编译时多态除了高性能之外的结果。

如果一定要这么做的话,有个方法是编译多个动态库,每一个动态库链接一个target

from scriptx.

LanderlYoung avatar LanderlYoung commented on May 21, 2024

不过还有一个cmake的限制,这两个动态库必须用两个CMakeLists配置

from scriptx.

yqs112358 avatar yqs112358 commented on May 21, 2024

我在两个不同的backend编译时确实用的是不同的CMakeList
他们在不同的目录中
最后由最顶层的CMakeList使用add_subdirectory进行分别构建
结果仍然出现了这个问题
难道说必须要修改ScriptX自带的CMakeList中的Project名才可以解决问题吗。。。

from scriptx.

yqs112358 avatar yqs112358 commented on May 21, 2024

我看到ScriptX里面写的是add_library(ScriptX STATIC
把他改成动态库就可以解决问题了?

from scriptx.

LanderlYoung avatar LanderlYoung commented on May 21, 2024

不是的,你不能用一个cmake工程编译两个后端。
只能用两个cmake工程(顶层CMakeLists)

from scriptx.

LanderlYoung avatar LanderlYoung commented on May 21, 2024

其实我也很好奇你有什么样的需求,需要同时编译多个后端

from scriptx.

yqs112358 avatar yqs112358 commented on May 21, 2024

哈!
其实就是做一个多语言的插件加载器
一次构建同时生成多种语言对应的DLL

所以说得多个顶层CMakeLists咯😱那样到时候构建就麻烦了
虽然说可以靠bat。。。hhh

from scriptx.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.