MethanePowered / MethaneKit

🎲 Modern 3D graphics made simple with C++17 cross-platform framework and rendering abstraction API on top of DirectX 12, Metal & Vulkan
Apache License 2.0
846 stars 51 forks source link

Build broken on OSX #86

Closed castral closed 3 years ago

castral commented 3 years ago

Describe the bug Can't build on OSX, get the following error from the Build.sh script on command line:


The following build commands failed:
    ProcessPCH++ /Users/castral/workspace/MethaneKit/Build/Output/Xcode/Build/Modules/Common/PrecompiledHeaders/SharedPrecompiledHeaders/SharedPrecompiledHeaders/1460692620919718071/cmake_pch.hxx.gch /Users/castral/workspace/MethaneKit/Build/Output/Xcode/Build/Modules/Common/PrecompiledHeaders/CMakeFiles/MethanePrecompiledExtraHeaders.dir/Release/cmake_pch.hxx normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Methane build failed.

And the following error from CMake in CLion:

[ 63%] Building CXX object Modules/Platform/Input/CMakeFiles/MethanePlatformInput.dir/Sources/Methane/Platform/Keyboard.cpp.o
In file included from /Users/castral/workspace/MethaneKit/Modules/Platform/AppView/Sources/Methane/Platform/MacOS/AppViewMT.mm:28:
In file included from /Users/castral/workspace/MethaneKit/Modules/Data/Types/Include/Methane/Data/TimeRange.hpp:26:
In file included from /Users/castral/workspace/MethaneKit/Modules/Data/Types/Include/Methane/Data/Types.h:26:
In file included from /Users/castral/workspace/MethaneKit/Modules/Data/Types/Include/Methane/Data/Vector.hpp:36:
In file included from /Users/castral/workspace/MethaneKit/Externals/HLSLpp/include/hlsl++.h:132:
/Users/castral/workspace/MethaneKit/Externals/HLSLpp/include/hlsl++_vector_int.h:391:23: error: definition of implicit copy constructor for 'int4' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
                hlslpp_inline int4& operator = (const int4& i) { vec = i.vec; return *this; }
                                    ^
/Users/castral/workspace/MethaneKit/Externals/HLSLpp/include/hlsl++_vector_int.h:453:61: note: in implicit copy constructor for 'hlslpp::int4' first required here
        hlslpp_inline int4 operator ++ (int4& i, int) { int4 tmp = i; i = i + int4(i4_1); return tmp; }
                                                                   ^
In file included from /Users/castral/workspace/MethaneKit/Modules/Platform/AppView/Sources/Methane/Platform/MacOS/AppViewMT.mm:28:
In file included from /Users/castral/workspace/MethaneKit/Modules/Data/Types/Include/Methane/Data/TimeRange.hpp:26:
In file included from /Users/castral/workspace/MethaneKit/Modules/Data/Types/Include/Methane/Data/Types.h:26:
In file included from /Users/castral/workspace/MethaneKit/Modules/Data/Types/Include/Methane/Data/Vector.hpp:36:
In file included from /Users/castral/workspace/MethaneKit/Externals/HLSLpp/include/hlsl++.h:134:
/Users/castral/workspace/MethaneKit/Externals/HLSLpp/include/hlsl++_vector_uint.h:396:24: error: definition of implicit copy constructor for 'uint4' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
                hlslpp_inline uint4& operator = (const uint4& i) { vec = i.vec; return *this; }
                                     ^
/Users/castral/workspace/MethaneKit/Externals/HLSLpp/include/hlsl++_vector_uint.h:463:64: note: in implicit copy constructor for 'hlslpp::uint4' first required here
        hlslpp_inline uint4 operator ++ (uint4& i, int) { uint4 tmp = i; i = i + uint4(1); return tmp; }
                                                                      ^
Scanning dependencies of target MethaneGraphicsPrimitives
[ 63%] Building CXX object Modules/Graphics/Primitives/CMakeFiles/MethaneGraphicsPrimitives.dir/Sources/Methane/Graphics/FpsCounter.cpp.o
[ 63%] Building CXX object Modules/Platform/Input/CMakeFiles/MethanePlatformInput.dir/Sources/Methane/Platform/Mouse.cpp.o
2 errors generated.
make[3]: *** [Modules/Platform/AppView/CMakeFiles/MethanePlatformAppView.dir/Sources/Methane/Platform/MacOS/AppViewMT.mm.o] Error 1
make[3]: *** Waiting for unfinished jobs....
Scanning dependencies of target MethaneGraphicsCamera
[ 63%] Building CXX object Modules/Graphics/Camera/CMakeFiles/MethaneGraphicsCamera.dir/Sources/Methane/Graphics/Camera.cpp.o
make[2]: *** [Modules/Platform/AppView/CMakeFiles/MethanePlatformAppView.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
[ 65%] Building CXX object Modules/Graphics/Primitives/CMakeFiles/MethaneGraphicsPrimitives.dir/Sources/Methane/Graphics/Mesh.cpp.o
[ 65%] Building CXX object Modules/Data/Provider/CMakeFiles/MethaneDataProvider.dir/Sources/Methane/Data/Provider.cpp.o
[ 65%] Building CXX object Modules/Data/Primitives/CMakeFiles/MethaneDataPrimitives.dir/Sources/Methane/Data/Primitives.cpp.o
In file included from /Users/castral/workspace/MethaneKit/Modules/Platform/Input/Sources/Methane/Platform/Mouse.cpp:24:
In file included from /Users/castral/workspace/MethaneKit/Modules/Platform/Input/Include/Methane/Platform/Mouse.h:26:
In file included from /Users/castral/workspace/MethaneKit/Modules/Data/Types/Include/Methane/Data/Point.hpp:26:
In file included from /Users/castral/workspace/MethaneKit/Modules/Data/Types/Include/Methane/Data/Vector.hpp:36:
In file included from /Users/castral/workspace/MethaneKit/Externals/HLSLpp/include/hlsl++.h:132:
/Users/castral/workspace/MethaneKit/Externals/HLSLpp/include/hlsl++_vector_int.h:391:23: error: definition of implicit copy constructor for 'int4' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
                hlslpp_inline int4& operator = (const int4& i) { vec = i.vec; return *this; }
                                    ^
/Users/castral/workspace/MethaneKit/Externals/HLSLpp/include/hlsl++_vector_int.h:453:61: note: in implicit copy constructor for 'hlslpp::int4' first required here
        hlslpp_inline int4 operator ++ (int4& i, int) { int4 tmp = i; i = i + int4(i4_1); return tmp; }
                                                                   ^
In file included from /Users/castral/workspace/MethaneKit/Modules/Platform/Input/Sources/Methane/Platform/Mouse.cpp:24:
In file included from /Users/castral/workspace/MethaneKit/Modules/Platform/Input/Include/Methane/Platform/Mouse.h:26:
In file included from /Users/castral/workspace/MethaneKit/Modules/Data/Types/Include/Methane/Data/Point.hpp:26:
In file included from /Users/castral/workspace/MethaneKit/Modules/Data/Types/Include/Methane/Data/Vector.hpp:36:
In file included from /Users/castral/workspace/MethaneKit/Externals/HLSLpp/include/hlsl++.h:134:
/Users/castral/workspace/MethaneKit/Externals/HLSLpp/include/hlsl++_vector_uint.h:396:24: error: definition of implicit copy constructor for 'uint4' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
                hlslpp_inline uint4& operator = (const uint4& i) { vec = i.vec; return *this; }
                                     ^
/Users/castral/workspace/MethaneKit/Externals/HLSLpp/include/hlsl++_vector_uint.h:463:64: note: in implicit copy constructor for 'hlslpp::uint4' first required here
        hlslpp_inline uint4 operator ++ (uint4& i, int) { uint4 tmp = i; i = i + uint4(1); return tmp; }
                                                                      ^
[ 67%] Building CXX object Modules/Graphics/Camera/CMakeFiles/MethaneGraphicsCamera.dir/Sources/Methane/Graphics/ArcBallCamera.cpp.o
2 errors generated.
make[3]: *** [Modules/Platform/Input/CMakeFiles/MethanePlatformInput.dir/Sources/Methane/Platform/Mouse.cpp.o] Error 1
make[2]: *** [Modules/Platform/Input/CMakeFiles/MethanePlatformInput.dir/all] Error 2
[ 67%] Building CXX object Modules/Graphics/Primitives/CMakeFiles/MethaneGraphicsPrimitives.dir/Sources/Methane/Graphics/PerlinNoise.cpp.o
[ 68%] Linking CXX static library libMethaneDataProvider.a
[ 70%] Linking CXX static library libMethaneDataPrimitives.a
[ 70%] Built target MethaneDataProvider
[ 70%] Building CXX object Modules/Graphics/Camera/CMakeFiles/MethaneGraphicsCamera.dir/Sources/Methane/Graphics/ActionCamera.cpp.o
[ 70%] Built target MethaneDataPrimitives
[ 70%] Linking CXX static library libMethaneGraphicsPrimitives.a
[ 70%] Built target MethaneGraphicsPrimitives
[ 70%] Linking CXX static library libMethaneGraphicsCamera.a
[ 70%] Built target MethaneGraphicsCamera
make[1]: *** [Apps/Tutorials/01-HelloTriangle/CMakeFiles/MethaneHelloTriangle.dir/rule] Error 2
make: *** [MethaneHelloTriangle] Error 2

Steps To Reproduce Steps to reproduce the behavior:

  1. Fresh clone and following the instructions on the readme.
egorodet commented 3 years ago

@castral Could you please check and report your versions of CMake, Xcode and Clang? Are you using Mac with Intel or Apple processor?

egorodet commented 3 years ago

I reproduced the build problem on my Mac, while it does not reproduce in Azure CI (don't know why yet). I'm looking into fixing this. Thanks for reporting the problem!