如何在OSX上构建flatbuffers?

lau*_*ent 4 c++ macos xcode build flatbuffers

我正在尝试在OSX上构建flatbuffers,但我不确定如何准确地进行.根据文件.我应该跑cmake -G "Xcode".我做到了并得到了结果:

-- The C compiler identification is Clang 5.1.0
-- The CXX compiler identification is Clang 5.1.0
-- Check for working C compiler using: Xcode
-- Check for working C compiler using: Xcode -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Xcode
-- Check for working CXX compiler using: Xcode -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: Temp/flatbuffers
Run Code Online (Sandbox Code Playgroud)

但是从那里我不知道该怎么做.我试过运行make但得到了错误信息make: *** No targets specified and no makefile found. Stop..知道如何构建它吗?

pep*_*kin 12

相反make,只需在shell中运行以下命令:

$ cmakexbuild

完成后,您将进入flatc./Debug文件夹.


Aar*_*pel 8

当您运行cmake时,您为Xcode IDE生成了一个项目(可从Apple应用商店下载).

如果要使用make构建,请改用以下命令:

cmake -G"Unix Makefiles"
Run Code Online (Sandbox Code Playgroud)

在那之后,make应该按预期工作.


小智 5

在OSX上,建议使用Homebrew安装Flatbuffer模式编译器。

brew install flatbuffers
Run Code Online (Sandbox Code Playgroud)

用法:使用架构编译器