Escaping compiler and linker options causes wrong behaviour
Created by: shybovycha
On OSX the -framework
is a valid linker CLI flag, which could be set in Buck with usual cxx_binary
/ cxx_library
rules which, in combination with platform_linker_flags
allows to go away from platform-dependent targets.
But due to argument escaping turned on by default, clang complains about unknown arguments:
cxx_binary(
name = 'main',
srcs = [ 'main.cpp' ],
platform_linker_flags = [
('macos', [
'-framework $SDKROOT/System/Library/Frameworks/Cocoa.framework',
])
],
)
gives
unknown argument: '-framework $SDKROOT/System/Library/Frameworks/Cocoa.framework'
The behaviors defined in buck sources do not consider any way to disable this escaping. I tried getting around this by defining a new option for [cxx]
section in .buckconfig
, but I could not get my head around com.facebook.buck.cxx.CxxPrepareForLinkStep
- simply can't see a good way to pass the option there.