mirror of
https://github.com/openai/codex.git
synced 2026-10-19 16:17:49 +00:00
Supply Bazel-managed CMake and Ninja for the bundled Opus build (#43083)
## Why The bundled Opus encoder uses CMake and should not depend on tools available on a build worker's `PATH`. ## What changed - Add `rules_foreign_cc` and provide its pinned CMake and Ninja tools and data to the `opusic-sys` build script. - Add a CMake toolchain file that selects the declared Ninja executable, resolves the archiver path, and sets the target system and processor from `TARGET`, while retaining Bazel's compiler, SDK, and linker inputs. GitOrigin-RevId: 48580c506d088d8c76cce958589ff94da458bd79
This commit is contained in:
committed by
copyberry
parent
19b62211d9
commit
0683368584
Vendored
+2
@@ -1,4 +1,6 @@
|
||||
# All native build consumers must receive the same pinned source manifest.
|
||||
exports_files(["opus-toolchain.cmake"])
|
||||
|
||||
filegroup(
|
||||
name = "source_inputs",
|
||||
srcs = [
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
# CMake's generator must use the Ninja declared in the Bazel action.
|
||||
set(CMAKE_MAKE_PROGRAM "$ENV{CODEX_VOICE_NINJA}" CACHE FILEPATH "" FORCE)
|
||||
# Archiver paths from Bazel are relative to the execution root.
|
||||
get_filename_component(CMAKE_AR "$ENV{AR}" ABSOLUTE
|
||||
BASE_DIR "${CMAKE_CURRENT_LIST_DIR}/../..")
|
||||
if("$ENV{TARGET}" MATCHES "apple-darwin$")
|
||||
set(CMAKE_SYSTEM_NAME Darwin)
|
||||
elseif("$ENV{TARGET}" MATCHES "windows")
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
else()
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
endif()
|
||||
string(REGEX REPLACE "-.*" "" CMAKE_SYSTEM_PROCESSOR "$ENV{TARGET}")
|
||||
# Compiler, SDK and linker inputs remain supplied by Bazel's target toolchain.
|
||||
Reference in New Issue
Block a user