18 Commits
Author SHA1 Message Date
Lucas Fernandes NogueiraandLucas Nogueira a7a4451b19 feat(sys): support cross-compiling to Windows with cargo-xwin (#462)
* feat(sys): support cross-compiling to Windows with cargo-xwin

Building `cef-dll-sys` for `x86_64-pc-windows-msvc` from a Linux host with
cargo-xwin failed while compiling `libcef_dll_wrapper` with clang-cl, for
four reasons that are now handled in the build script:

- CEF's CMake clears `CMAKE_CXX_FLAGS` for the Ninja generator, dropping
  the toolchain's `--target` and `/imsvc` include paths. They are now passed
  through `CEF_C_COMPILER_FLAGS`/`CEF_CXX_COMPILER_FLAGS` instead, which CEF
  appends after its own flags.
- clang-cl reports diagnostics that MSVC doesn't (`/MP` is unsupported,
  `-Wmissing-field-initializers`, `-Wundefined-var-template`) and CEF's `/WX`
  turned them into errors. Those are silenced and `/WX-` is appended.
- The Windows SDK import libraries were merged into the wrapper archive
  through `CMAKE_STATIC_LINKER_FLAGS`, which llvm-lib can't do because it
  rejects the XFG hash map member of current import libraries. They are
  now emitted as `cargo::rustc-link-lib` directives for the final link.
- The SDK expects case-insensitive header lookups (`Softpub.h` vs
  `SoftPub.h`). Mismatched headers get a correctly-cased copy in an extra
  include directory under `OUT_DIR`.

The `cc` crate is used to detect clang-cl and to read the target CXXFLAGS,
so this is a no-op for native MSVC builds. A CI job cross-compiles the
`cefsimple` example on ubuntu-latest to keep this working.

* fix(sys): join clang-cl options that take a separate argument

cargo-xwin 0.23 exports the SDK include paths as `/imsvc <dir>` (two
tokens) where 0.19 used `/imsvc<dir>`. CMake de-duplicates compile
options, so every repeated `/imsvc` after the first was dropped and the
bare paths were passed to clang-cl as additional source files:

    clang-cl: error: cannot specify '/Fo...' when compiling multiple source files

Join such option/value pairs into a single token before handing the flags
to CMake, and only add the clang-cl specific flags that aren't already
present so de-duplication has nothing left to remove.

* ci: use LLVM 20 for the Windows cross-compile job

The MSVC STL headers that cargo-xwin downloads now refuse compilers older
than Clang 19 (STL1000), and ubuntu-latest ships Clang 18. Install LLVM 20
from apt.llvm.org and put it first on PATH: cargo-xwin symlinks its
`clang-cl` to the `clang` found there, so only the SDK directory is cached.

* cleanup

---------

Co-authored-by: Lucas Nogueira <lucas@crabnebula.dev>
2026-09-14 10:09:51 -03:00
Bill Avery 40c85f465c feat: Nix support (#426, #467) 2026-09-11 10:45:20 -07:00
Bill Avery 87a031bb1d fix(doc): update README for bundle-cef-app 2026-01-01 15:34:55 -08:00
Bill Avery e66a73c60e feat(test): port tests/shared library from CEF
feat: unify bundle utilities under cef build-util feature

feat: reenable sandbox support in cefsimple

feat: add MainMenu.xib on mac

fix: bypass tryToTerminateApplication for Command+Q

fix: enable much smaller linux release builds
2026-01-01 15:34:55 -08:00
Guyoung Studio d832fccab1 Fix path for Windows PowerShell example 2025-10-22 13:26:28 +08:00
Bill Avery a11e513598 chore: move examples into separate crates 2025-07-28 22:02:12 -07:00
Bill Avery acd9dec69d fix: try adding quotes around path variables 2025-06-28 01:31:25 -07:00
Bill Avery 2de10def56 fix: add libraries directory to search path on macos 2025-06-28 01:04:36 -07:00
Bill Avery 33c06b1bf4 fix: cleanup shell script samples 2025-03-22 15:53:32 -07:00
Bill Avery 2ac44d85fa fix(doc): update macOS bundle instructions 2025-03-12 23:00:49 -07:00
Bill Avery 2b3ce9c73f chore(doc): update README explaining how to use export-cef-dir 2025-02-06 21:06:44 -08:00
Bill Avery 62db1941a2 fix: unit tests and bundle_script work with cef-dll-sys on macos 2025-01-18 13:57:45 -08:00
csmoe 9624f8c10c update macos example build&run doc 2025-01-14 13:38:27 +08:00
Wu Yu Wei 03d96f78be Update crate doc to README 2023-10-20 20:58:42 +09:00
Ngo Iok Ui (Wu Yu Wei) 926a67a70e Update README.md 2023-10-19 22:22:45 +09:00
Wu Yu Wei 583127a89e Update README 2023-06-08 13:36:19 +08:00
Wu Yu Wei cd088c4390 Update flatpak manifest 2023-06-01 19:31:53 +08:00
Wu Yu Wei cbb6fd3208 Add README.md 2023-06-01 16:38:07 +08:00