--
c64b6fd3a44b385e1502d2057bd8709edaebaa58 by David Coles <dcoles@dcoles.net>:
Include Windows in GitHub Actions build
This also preserves the `gemma` binary as a build artefact
should folks want to grab a pre-built binary.
Dropped the use of the lukka/cmake actions due to conflicts with `--preset`.
This isn't that bad as we were mostly overriding the default behaviour anyway.
It also shaves ~2 min off the build since the GitHub builders already
have CMake pre-installed.
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/gemma.cpp/pull/38 from dcoles:windows-build c64b6fd3a44b385e1502d2057bd8709edaebaa58
PiperOrigin-RevId: 610449220
--
e0179bad83 by Dan Zheng <danielzheng@google.com>:
Rename BUILD to BUILD.bazel.
This fixes an error on macOS due to `build` and `BUILD` having conflicting names.
--
74b27074e1 by Dan Zheng <danielzheng@google.com>:
Enable macos-latest in GitHub Actions CI.
--
c08de58e6a by Dan Zheng <danielzheng@google.com>:
Fix concurrency key in GitHub Actions.
Use matrix configuration in concurrency key.
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/gemma.cpp/pull/36 from dan-zheng:rename-build-bzl b4b978f02b
PiperOrigin-RevId: 610156681
--
19694e1f2e by Silvio Traversaro <silvio@traversaro.it>:
Do not pass explicitly -O2 flag to compiler in Release build
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/gemma.cpp/pull/3 from traversaro:patch-1 19694e1f2e
PiperOrigin-RevId: 610096914
* Rename BUILD to BUILD.bazel.
This fixes an error on macOS due to `build` and `BUILD` having conflicting names.
* Enable macos-latest in GitHub Actions CI.
* Fix concurrency key in GitHub Actions.
Use matrix configuration in concurrency key.
Using a `CMakePresets.json` file makes it much easier to manage
several alternate build configurations, such as the "ClangCL"
build for Windows. This also makes it easier for tools like
VSCode to run CMake-based builds.
It's not possible to build `gemma.cpp` with the standard MSVC front-end
as it doesn't support arrays more than `0x7ffffffff` bytes (see Compiler Error C2148),
however this isn't a problem with the optional Visual Studio Clang/LLVM frontend.
This can be specified using the `-T` flag when running CMake:
```
$ cmake -B build -T ClangCL
$ cmake --build build --config Release
```
Windows doesn't provide `pread`/`pwrite` so this must be emulated using
the `ReadFile`/`WriteFile` Win32 APIs.
`_CRT_SECURE_NO_WARNINGS` is defined to prevent a large number of warnings
about using "depricated" function names (e.g. `close` instead of `_close`).
`NOMINMAX` is defined to prevent the `min`/`max` macros from `windows.h`
from conflicting with expressions like `std::min`. Generally libraries should
avoid including `windows.h` in their public headers or define `WIN32_LEAN_AND_MEAN`
before including the `windows.h` header, but this unfortunately isn't always the case.
Discussed using dev branch instead of main branch for development.
We could revisit this once CI is hardened to test end-to-end correctness.
PiperOrigin-RevId: 609500897