google / google/gapid

./core/cc/target.h:41:9: error: 'TARGET_OS' macro redefined [-Werror,-Wmacro-redefined] #define TARGET_OS GAPID_OS_OSX

Open
#3,877 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.2k
Forks
329
PR merge metrics
No merged PRs in 30d

Description

ERROR: /Users/chenxiaojiong/Desktop/project/googel/2/gapid/core/os/device/deviceinfo/cc/BUILD.bazel:28:1: C++ compilation of rule '//core/os/device/deviceinfo/cc:cc' failed (Exit 1) wrapped_clang failed: error executing command
(cd /private/var/tmp/_bazel_chenxiaojiong/fbc10ff03d7172ef2cc1b34707b1af70/sandbox/darwin-sandbox/313/execroot/gapid && \
exec env - \
APPLE_SDK_PLATFORM=MacOSX \
APPLE_SDK_VERSION_OVERRIDE=12.1 \
PATH=/Users/chenxiaojiong/Library/Java/JavaVirtualMachines/corretto-1.8.0_312/Contents/Home/bin:/Library/Frameworks/Python.framework/Versions/3.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/chenxiaojiong/Desktop/project/googel/sdk/build-tools/29.0.2/aapt:/Users/chenxiaojiong/Desktop/project/googel/sdk/platform-tools:/Users/chenxiaojiong/Desktop/project/googel/sdk/ndk-bundle:/Users/chenxiaojiong/bin \
XCODE_VERSION_OVERRIDE=13.2.0.13C90 \
external/local_config_cc/wrapped_clang '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -O0 -DDEBUG '-std=c++11' -iquote . -iquote bazel-out/darwin-fastbuild/bin -iquote external/breakpad -iquote bazel-out/darwin-fastbuild/bin/external/breakpad -iquote external/cityhash -iquote bazel-out/darwin-fastbuild/bin/external/cityhash -iquote external/com_google_protobuf -iquote bazel-out/darwin-fastbuild/bin/external/com_google_protobuf -iquote external/net_zlib -iquote bazel-out/darwin-fastbuild/bin/external/net_zlib -Ibazel-out/darwin-fastbuild/bin/external/breakpad/_virtual_includes/breakpad -Ibazel-out/darwin-fastbuild/bin/external/breakpad/_virtual_includes/breakpad_darwin -Ibazel-out/darwin-fastbuild/bin/external/breakpad/_virtual_includes/breakpad_darwin_defines -Ibazel-out/darwin-fastbuild/bin/external/cityhash/_virtual_includes/cityhash -isystem external/com_google_protobuf/src -isystem bazel-out/darwin-fastbuild/bin/external/com_google_protobuf/src -MD -MF bazel-out/darwin-fastbuild/bin/core/os/device/deviceinfo/cc/_objs/cc/gl.d '-frandom-seed=bazel-out/darwin-fastbuild/bin/core/os/device/deviceinfo/cc/_objs/cc/gl.o' -isysroot __BAZEL_XCODE_SDKROOT__ -F__BAZEL_XCODE_SDKROOT__/System/Library/Frameworks -F__BAZEL_XCODE_DEVELOPER_DIR__/Platforms/MacOSX.platform/Developer/Library/Frameworks '-mmacosx-version-min=12.1' '-std=c++11' -Werror -DTARGET_OS_OSX -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c core/os/device/deviceinfo/cc/gl.cpp -o bazel-out/darwin-fastbuild/bin/core/os/device/deviceinfo/cc/_objs/cc/gl.o)
Execution platform: @local_config_platform//:host

Use --sandbox_debug to see verbose messages from the sandbox
In file included from core/os/device/deviceinfo/cc/gl.cpp:20:
In file included from ./core/cc/assert.h:20:
In file included from ./core/cc/log.h:39:
./core/cc/target.h:41:9: error: 'TARGET_OS' macro redefined [-Werror,-Wmacro-redefined]
#define TARGET_OS GAPID_OS_OSX
^
./core/cc/target.h:31:9: note: previous definition is here
#define TARGET_OS GAPID_OS_LINUX
^
./core/cc/target.h:66:9: error: 'TARGET_OS' macro redefined [-Werror,-Wmacro-redefined]
#define TARGET_OS GAPID_OS_WINDOWS
^
./core/cc/target.h:41:9: note: previous definition is here
#define TARGET_OS GAPID_OS_OSX
^
./core/cc/target.h:67:9: error: 'STDCALL' macro redefined [-Werror,-Wmacro-redefined]
#define STDCALL __stdcall
^
./core/cc/target.h:42:9: note: previous definition is here
#define STDCALL
^
./core/cc/target.h:68:9: error: 'EXPORT' macro redefined [-Werror,-Wmacro-redefined]
#define EXPORT __declspec(dllexport)
^
./core/cc/target.h:43:9: note: previous definition is here
#define EXPORT __attribute__((visibility("default")))
^
./core/cc/target.h:69:9: error: 'PATH_DELIMITER' macro redefined [-Werror,-Wmacro-redefined]
#define PATH_DELIMITER '\\'
^
./core/cc/target.h:44:9: note: previous definition is here
#define PATH_DELIMITER '/'
^
./core/cc/target.h:70:9: error: 'PATH_DELIMITER_STR' macro redefined [-Werror,-Wmacro-redefined]
#define PATH_DELIMITER_STR "\\"
^
./core/cc/target.h:45:9: note: previous definition is here
#define PATH_DELIMITER_STR "/"
^
6 errors generated.
Target //core/os/device/deviceinfo/cc:cc failed to build
INFO: Elapsed time: 78.907s, Critical Path: 24.49s
INFO: 310 processes: 310 darwin-sandbox.
FAILED: Build did NOT complete successfully

**The environment is:**
gapid master branch

OS
![image](https://user-images.githubusercontent.com/14952406/150663132-b0e7a840-7f69-4270-8571-a83f88770cb2.png)

GCC
![image](https://user-images.githubusercontent.com/14952406/150714842-49a47e28-22ed-40a9-a405-cdddc5e7e864.png)

bazel
Build label: 4.2.2

Does anyone know how to fix it?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.