Skip to content

0.2.3 does not build with sccache on macOS #13

Description

@virtualritz

Trying to compile the examples for bevy on macOS I get spirv-reflect failing:
os: macOS 10.15.6
compiler: Apple clang 11.0.3

warning: error: invalid argument '-std=c++11' not allowed with 'C'

error: failed to run custom build command for `spirv-reflect v0.2.3`

Caused by:
  process didn't exit successfully: `/Users/moritz/code/crates/bevy/target/debug/build/spirv-reflect-e0c20f0369bf5f90/build-script-build` (exit code: 1)
  --- stdout
  TARGET = Some("x86_64-apple-darwin")
  OPT_LEVEL = Some("0")
  HOST = Some("x86_64-apple-darwin")
  CXX_x86_64-apple-darwin = None
  CXX_x86_64_apple_darwin = None
  HOST_CXX = None
  CXX = None
  CXXFLAGS_x86_64-apple-darwin = None
  CXXFLAGS_x86_64_apple_darwin = None
  HOST_CXXFLAGS = None
  CXXFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("cmpxchg16b,fxsr,mmx,sse,sse2,sse3,ssse3")
  running: "sccache" "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-arch" "x86_64" "-stdlib=libc++" "-I" "src" "-Wall" "-Wextra" "-std=c++11" "-Wno-missing-field-initializers" "-Wno-sign-compare" "-Wno-deprecated" "-o" "/Users/moritz/code/crates/bevy/target/debug/build/spirv-reflect-c4be2b0e2b8154af/out/vendor/spirv_reflect.o" "-c" "vendor/spirv_reflect.c"
  cargo:warning=error: invalid argument '-std=c++11' not allowed with 'C'
  exit code: 1

  --- stderr


  error occurred: Command "sccache" "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-arch" "x86_64" "-stdlib=libc++" "-I" "src" "-Wall" "-Wextra" "-std=c++11" "-Wno-missing-field-initializers" "-Wno-sign-compare" "-Wno-deprecated" "-o" "/Users/moritz/code/crates/bevy/target/debug/build/spirv-reflect-c4be2b0e2b8154af/out/vendor/spirv_reflect.o" "-c" "vendor/spirv_reflect.c" with args "c++" did not execute successfully (status code exit code: 1).

I guess this is LLVM/clang asking to be concise. If vendor/spirv_reflect.c is C, omit C++ flags. If it is C++, rename it to vendor/spirv_reflect.cpp. But that's just a guess.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions