sdgfsdh
sdgfsdh

Reputation: 37121

What are the common platform names in Buck?

I would like to build a cross-platform cxx_library with . I have different cpp files for the different platforms. According to the docs, I can handle this using platform_srcs, which is:

...a list of pairs where the first element is an un-anchored regex (in java.util.regex.Pattern syntax) against which the platform name is matched".

Upvotes: 2

Views: 348

Answers (2)

sdgfsdh
sdgfsdh

Reputation: 37121

I am using the following:

  • Android: android.*
  • iPhone: iphoneos.*
  • iPhone Simulator: iphonesimulator*
  • Linux: linux.*
  • macOS: macos.*
  • Windows: windows.*

Don't forget to turn on should_remap_host_platform in order to avoid 'default' platform weirdness. In your .buckconfig:

[cxx]
  should_remap_host_platform = true

See: https://github.com/facebook/buck/issues/2073

Upvotes: 1

sdwilsh
sdwilsh

Reputation: 4682

Android: android

iPhone: iphoneos

iPhone Simulator: iphonesimulator

Linux: Unsure

OSX: Unsure

Windows: ^windows.*

Upvotes: 1

Related Questions