Skip to content

Commit

Permalink
TinyCC: -framework support, __attribute__(deprecated(string)) in…
Browse files Browse the repository at this point in the history
… enum, fix dlsym issue (#13993)

Co-authored-by: Dylan Conway <[email protected]>
  • Loading branch information
Jarred-Sumner and dylan-conway authored Sep 17, 2024
1 parent c74ec5a commit 6d98bcc
Show file tree
Hide file tree
Showing 7 changed files with 291 additions and 68 deletions.
2 changes: 1 addition & 1 deletion cmake/targets/BuildTinyCC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ register_repository(
REPOSITORY
oven-sh/tinycc
COMMIT
ab631362d839333660a265d3084d8ff060b96753
29985a3b59898861442fa3b43f663fc1af2591d7
)

register_cmake_command(
Expand Down
48 changes: 48 additions & 0 deletions packages/bun-types/ffi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,54 @@ declare module "bun:ffi" {
* Map of symbols to load where the key is the symbol name and the value is the {@link FFIFunction}
*/
symbols: Fns;

/**
* Map of symbols to define where the key is the symbol name and the value is the symbol value
*
* Equivalent to `-D` option in gcc/clang.
*
* @example
* ```js
* import { cc } from "bun:ffi";
* const {symbols: {hello}} = cc({
* source: hello,
* define: {
* "NDEBUG": "1",
* },
* symbols: {
* hello: {
* returns: "cstring",
* args: [],
* },
* },
* });
* ```
*/
define?: Record<string, string>;

/**
* Flags to pass to the compiler. Note: we do not make gurantees about which specific version of the compiler is used.
*
* @default "-std=c11 -Wl,--export-all-symbols -g -O2"
*
* This is useful for passing macOS frameworks to link against. Or if there are other options you want to pass to the compiler.
*
* @example
* ```js
* import { cc } from "bun:ffi";
* const {symbols: {hello}} = cc({
* source: hello,
* flags: ["-framework CoreFoundation", "-framework Security"],
* symbols: {
* hello: {
* returns: "cstring",
* args: [],
* },
* },
* });
* ```
*/
flags?: string | string[];
}): Library<Fns>;

/**
Expand Down
Loading

0 comments on commit 6d98bcc

Please sign in to comment.