English 中文(简体)
我怎么能让CMake与空洞方案语言合作?
原标题:How do I get CMake to work with the go programming language?
  • 时间:2011-11-02 10:03:03
  •  标签:
  • cmake
  • go

我一直在使用C++的CMake来建造图书馆和可以起诉的图书馆,并希望在go式节目制作语言上使用同样的文字。

www.un.org/Depts/DGACM/index_spanish.htm 我需要采取哪些步骤来召集会议。 CMake,这样,它就能够使用 go节目语言?。

基本上,我的汇编者是6g人,产生汇编的oo.6——我通过6l foo.6将其送到联系人,我是这样做的。 我已经建立并安装了汇编器和链接器。

Obviously, I can just write a simple Makefile for this, but it would be nice to use CMake consistently throughout my project.

TIA就帮助我的任何建议提出建议。

最佳回答

您不妨对戈马的支持。 大约说它涉及以下步骤:

  1. Create CMakeDetermineGoCompiler.cmake module, which would find Go compiler for the current system.
  2. Create CMakeGoCompiler.cmake.in - a template, which would be configured by CMakeDetermineGoCompiler.

  3. Create CMakeTestGoCompiler.cmake, module which would compile a simple go source to check if the compiler works.

  4. Create CMakeGoInformation.cmake, which would set some language-related variables (CMAKE_GO_LINK_EXECUTABLE and so on)

这些事情应当放在CMAKE_中。 MODULES_DIR. 供参考的,请看 Java/XX如何提供支助。

另一种做法是,如果不想给我这样的内部问题,那么你就可以通过创建一种宏观(宏观)来完成你的任务,这将形成一套习惯目标/共同点(见“Ccustarget,command}(见)文件)。

问题回答

避免使用CMake(或任何其他建筑系统)符合你的最佳利益。

Go有一套简单的、内在的办法来建立包件:go Building (其中还使cc /code>和go 安装 work)。 <代码>go Building,经设计,不需要其他工具,如制造或 cm。

如果你使用CMake(或任何其他建筑系统),你会给他人(如果你计划使用他人开发的图书馆)或他人(如果你计划开发其他用途的图书馆)的生活带来困难。

我创造了一个简单的道路。 利用CMake将C/C++和Go相结合的碎块模块。

https://github.com/krumberg/cmake_go”rel=“nofollow noreferer”>https://github.com/krumberg/cmake_go





相关问题
Why can t CLion see header files, WSL2 toolchain?

My setup: Windows 10 Pro 22H2 (19045.2965) CLion 2020.1.3 (JetBrains) WSL2 with Ubuntu 22.04.2 LTS gcc 11.3.0 cmake 3.22.1 gdb 12.1 gmake 4.3 CMakeLists.txt cmake_minimum_required(VERSION 3.22)...

CMake linking problem

I am trying to use CMake to compile a C++ application that uses the C library GStreamer. My main.cpp file looks like this: extern "C" { #include <gst/gst.h> #include <glib.h> } int main(...

How to add an extra plist property using CMake?

I m trying to add the item <key>UIStatusBarHidden</key><true/> to my plist that s auto-generated by CMake. For certain keys, it appears there are pre-defined ways to add an item; ...

(c)make - resursive compile

Let s assume I have directories like: dir1 main.cpp dir2 abc.cpp dir3 def.cpp dir4 ghi.cpp jkl.cpp And let s assume that main.cpp ...

Reading registry values with cmake

On a Windows 7 machine I cannot read any registry values that contain a semicolon. For example if you have 7-zip, running the following SET(MYPATH [HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip;Path]) ...

Finding the correct Python framework with cmake

I am using the macports version of python on a Snow Leopard computer, and using cmake to build a cross-platform extension to it. I search for the python interpreter and libraries on the system using ...

热门标签