Skip to content

Commit

Permalink
Add LTO back to non-Windows builds
Browse files Browse the repository at this point in the history
The Windows case (the option name is "/GL") is more complicated, since
there, the compiler options also need to be passed to the linker if LTO
is enabled.

Since we are gating the linker options on platform at the moment instead
of compiler, we need to implement a Bazel boolean flag for the case
"Platform == MacOS && Compiler == AnyOf(gcc, clang)".
  • Loading branch information
nicholasjng committed Oct 24, 2023
1 parent ac99815 commit 410c022
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bindings/python/nanobind.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ cc_library(
"/EHsc", # exceptions
"/Os", # size optimizations
],
# these should work on both clang and gcc.
"//conditions:default": [
"-fexceptions",
"-flto",
"-Os",
],
}),
Expand Down

0 comments on commit 410c022

Please sign in to comment.