Skip to content
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

Remove cmake dependency #34

Merged
merged 2 commits into from Mar 21, 2024
Merged

Conversation

jschwe
Copy link
Contributor

@jschwe jschwe commented Mar 20, 2024

Use cc-rs for the build of the native libraries.
This removes the dependency on cmake, which hopefully solves the
following issues:

  • cc-rs will link to the correct C++ stdlib depending on the compiler
    and the CXXSTDLIB / CXXSTDLIB_$target variables. Our buildscript
    previously only had a very simple target-based approach.
  • Fix random cases when cross-compiling (e.g. to -ohos), where the
    CMakeCache.txtwould contain the default host compiler and not
    respect the CMake toolchain file.
    This only happened when recompiling, and might involve a race
    depending on when exactly the parent servo compilation failed.

Use cc-rs for the build of the native libraries.
This removes the dependency on `cmake`, which hopefully solves the
following issues:

- `cc-rs` will link to the correct C++ stdlib depending on the compiler
   and the `CXXSTDLIB` / `CXXSTDLIB_$target` variables. Our buildscript
   previously only had a very simple target-based approach.
- Fix random cases when cross-compiling (e.g. to -ohos), where the
  `CMakeCache.txt`would contain the default host compiler and not
  respect the CMake toolchain file.
  This only happened when recompiling, and might involve a race
  depending on when exactly the parent servo compilation failed.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
@jschwe jschwe marked this pull request as ready for review March 21, 2024 06:04
@jschwe jschwe changed the title Draft: Remove cmake dependency Remove cmake dependency Mar 21, 2024
@jschwe
Copy link
Contributor Author

jschwe commented Mar 21, 2024

CC @mrobinson it seems that fontsan is actually the only dependency of servo using CMake, so this should also remove the CMake requirement for the servo build.

Copy link
Member

@mrobinson mrobinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like an improvement to me.

@mrobinson mrobinson added this pull request to the merge queue Mar 21, 2024
Merged via the queue into servo:main with commit cf5d003 Mar 21, 2024
6 checks passed
@jschwe jschwe deleted the jschwender/use-cc-rs branch March 21, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants