-
Notifications
You must be signed in to change notification settings - Fork 710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chapter-01/recipe-03/cxx-example doesn't work with Xcode generator #524
Comments
Hi, In any case the https://github.com/dev-cafe/cmake-cookbook/blob/master/chapter-01/recipe-03/cxx-example/CMakeLists.txt |
Here's the output from the Unix Makefiles build: ➜ build git:(master) ✗ cmake -G Unix\ Makefiles .. Here's the output from the Ninja build: ➜ build git:(master) ✗ cmake -G Ninja .. Here's the output from the Xcode build: ➜ build git:(master) ✗ cmake -G Xcode .. Prepare build Check dependencies Write auxiliary files PhaseScriptExecution CMake\ Rules build/recipe-03.build/Debug/ZERO_CHECK.build/Script-406544BC807847CAA30B7235.sh make -f /Users/schofield/Files/projects/cmake-cookbook/chapter-01/recipe-03/cxx-example/build/CMakeScripts/ReRunCMake.make === BUILD TARGET message-objs OF PROJECT recipe-03 WITH THE DEFAULT CONFIGURATION (Debug) === Check dependencies Write auxiliary files CompileC build/recipe-03.build/Debug/message-objs.build/Objects-normal/x86_64/Message.o Message.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler Libtool build/recipe-03.build/Debug/message-objs.build/libmessage-objs.a normal x86_64 PhaseScriptExecution CMake\ PostBuild\ Rules build/recipe-03.build/Debug/message-objs.build/Script-657800514D4B4277B20A6F97.sh === BUILD TARGET message-static OF PROJECT recipe-03 WITH THE DEFAULT CONFIGURATION (Debug) === Check dependencies === BUILD TARGET hello-world OF PROJECT recipe-03 WITH THE DEFAULT CONFIGURATION (Debug) === Check dependencies Write auxiliary files CompileC build/recipe-03.build/Debug/hello-world.build/Objects-normal/x86_64/hello-world.o hello-world.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler Ld build/Debug/hello-world normal x86_64 ** BUILD FAILED ** The following build commands failed: It appears as if the 'message-static' target doesn't actually do anything. |
Looks like a bug in Xcode generator. Note that the final message from the build of the library is suspicious: /bin/rm -f /Users/schofield/Files/projects/cmake-cookbook/chapter-01/recipe-03/cxx-example/build/Debug/libmessage-shared.dylib
/bin/rm -f /Users/schofield/Files/projects/cmake-cookbook/chapter-01/recipe-03/cxx-example/build/Debug/libmessage-static.a You should report this to CMake project, really looks like a bug of the generator to me. |
I can build chapter-01/recipe-03/cxx-example fine with Unix Makefiles or Ninja generator on macOS Catalina with Xcode 11.6. When I use the Xcode generator the hello-world target fails to build properly. Is this a bug in CMake's Xcode generator or can something be done differently in the CMakeLists.txt file to work around the problem?
Your Environment
The text was updated successfully, but these errors were encountered: