是否可以使用cmake Haskell项目? [英] Is it possible to use cmake for Haskell projects?

查看:190
本文介绍了是否可以使用cmake Haskell项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我计划在Haskell编写一个项目,也许在C中有一些部分。对于构建系统,我决定反对Haskell程序cabal的常见选择,主要是因为我想了解如何建立其他语言的程序工作。

I am planning a project written in Haskell, maybe there are some parts in C as well. For the buildsystem I decided against the common choice for Haskell programs cabal, mainly because I want to learn how building programs in other languages works.

我听说过CMake,它是一个很酷的产品。虽然我不知道如何使用它,我想使用CMake的项目,只是为了找到它的工作原理。 Googleing没有揭示任何关于如何使用cmake与haskell的事实,所有的教程我读了相当混乱。是可能的,如果是,使用CMake编译一个在Haskell中编写的项目是怎么可能的?

I heard about CMake and I think it is a pretty cool product. Although I have no knowledge in how to use it, I want to use CMake for that project, just to find out how it works. Googleing did not reveal any facts about how to use cmake with haskell, and all tutorials I read were rather confusing. Is it possible, and if yes, how is it possible, to compile a project written in Haskell using CMake?

推荐答案

肯定使用CMake来构建Haskell应用程序和库。要做到这一点,你需要复制Cabal的许多东西,这将是有启发性的,但也很耗时。

You can certainly use CMake to build Haskell applications and libraries. To do so, you will need to duplicate much of what Cabal does, which will be instructive, but also time consuming.

我建议使用 cabal build -v 查看Cabal发出的命令,然后将它们转换为CMake格式。

I'd recommend using cabal build -v to see the commands emitted by Cabal, and then transcribing them into CMake form.

或者,使用CMake调用cabal对Haskell代码 - 这很可能不讨厌。

Or, use CMake to call cabal on the Haskell code -- that's likely to be less annoying.

这篇关于是否可以使用cmake Haskell项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆