Game of Life doesn't build on MacOS Mojave
Given
$ cmake --version
cmake version 3.19.1
$ ninja --version
1.10.2
$ uname -a
Darwin MAC116793 18.7.0 Darwin Kernel Version 18.7.0: Fri Oct 30 12:37:06 PDT 2020; root:xnu-4903.278.44.0.2~1/RELEASE_X86_64 x86_64
and building VTK-m on top of commit 03b814a9,
build$ cmake -DVTKm_ENABLE_TESTING=ON -DVTKm_ENABLE_EXAMPLES=ON ../ -G Ninja
-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Found GLUT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/GLUT.framework
we obtain the build error
build$ ninja
ninja: error: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/GLUT.framework/GLUT', needed by 'examples/game_of_life/GameOfLife', missing and no known rule to make it
Indeed, this file is missing, but a similar file:
exa -la /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/GLUT.framework/
lrwxr-xr-x 25 root 25 Mar 7:34 GLUT.tbd -> Versions/Current/GLUT.tbd
does exist.
I can get around this by doing a find and replace in the build.ninja
of /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/GLUT.framework/GLUT
with /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/GLUT.framework/GLUT.tbd
.
This gets me to:
build$ ninja
ninja: error: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Cocoa.framework/Cocoa', needed by 'examples/game_of_life/GameOfLife', missing and no known rule to make it
Again, doing a find/replace in the build.ninja
of
Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Cocoa.framework/Cocoa
with
Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Cocoa.framework/Cocoa.tbd
fixed the problem, and I get a clean build.
This might be a duplicate of this bug, but I'll keep this here to document the workaround.