在OSX上使用Waf编译OpenGL/SDL应用程序时如何禁止'-arch','x86_64'标志?

Hal*_*ate 21 opengl macos sdl waf

我需要压制"-arch x86_64 -arch i386"标志Waf传递给GCC.

我正在构建一个SDL/Opengl应用程序.如果我链接32位SDL运行时我得到错误

    Undefined symbols for architecture i386:
  "_SDL_Quit", referenced from:
      __del_video in SDL_functions.c.2.o
      __init_video in SDL_functions.c.2.o
Run Code Online (Sandbox Code Playgroud)

如果我链接到64位SDL运行时,我会收到错误"架构x86_64的未定义符号"

编译器显然使用标志

-arch x86_64 -arch i386
Run Code Online (Sandbox Code Playgroud)

据我所知,这会导致OSX上的GCC尝试编译这两种架构.我想编译为64位,或编译为32位.如何抑制一个架构的标志?

Jer*_*rry 0

我不知道如何发出命令/标志来抑制其他标志。但是,要仅编译 64 位或 32 位,可以分别使用 -m64 或 -m32。由于您要针对两种体系结构进行编译,因此 -m32 可能是您唯一的选择,因为 -m64 不适用于 i386。