-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Building FoundationDB would fail if CMake uses Makefile #11595
Comments
@xis19 Curious what's your use-case for using Make vs Ninja? And do we support Make? |
I was trying to set up a minimal RHEL9 build environment and use the most essential build tools. Not sure if we support Make but for the same CMakeLists.txt if CMake generates problematic Makefile while reasonable build.ninja, the compiler's backend might be buggy, or the build.ninja has the same problem yet not being triggered. |
Got it, thanks for the context. Fwiw, README.md mentions: Install [Ninja](https://ninja-build.org/) (optional, but recommended) If Ninja is optional, I would take that to mean that people use Make and therefore Make should be working.
Agreed. |
This also fixes apple#11595 - if Unix Makefiles is chosen for CMake builds, build was failing with: ``` make[2]: *** No rule to make target 'actorcompiler.exe', needed by 'flow/ActorCollection.actor.g.cpp'. Stop. ``` I suspect it could have been a problem for Ninja as well since the issue was due to race condition, but probably it didn't happened so far for other unknown factors. See this example in CMake add_custom_command documentation: https://cmake.org/cmake/help/latest/command/add_custom_command.html#example-generating-files-for-multiple-targets The correct target to depend on is `actorcompiler` for CMake to generate the right dependency order, `${actor_exe}` is just a string that points to the location of the actor compiler.
This also fixes apple#11595 - if Unix Makefiles is chosen for CMake builds, build was failing with: ``` make[2]: *** No rule to make target 'actorcompiler.exe', needed by 'flow/ActorCollection.actor.g.cpp'. Stop. ``` I suspect it could have been a problem for Ninja as well since the issue was due to race condition, but probably it didn't happened so far for other unknown factors. See this example in CMake add_custom_command documentation: https://cmake.org/cmake/help/latest/command/add_custom_command.html#example-generating-files-for-multiple-targets The correct target to depend on is `actorcompiler` for CMake to generate the right dependency order, `${actor_exe}` is just a string that points to the location of the actor compiler. See here: https://github.com/apple/foundationdb/blob/4260bbb3c2e81531e1ec1493424544a2bea0c867/cmake/CompileActorCompiler.cmake#L26-L27
CMake generates problematic Makefile which not being able to create actorcompiler.exe. The error is
The text was updated successfully, but these errors were encountered: