Zulip Chat Archive
Stream: Is there code for X?
Topic: conditional compilation
Joachim Breitner (Dec 28 2023 at 15:35):
I have a lean executable (the loogle CLI) that I want to be able to compile with or (by default) without seccomp support. Seccomp support entails
- In the
lakefile.leanatarget, anextern_liband alean_lib - In the main
Loogle.leanoneimportand one line of code invoking it.
By default, a user runninglake buildshould see neither of these, butlake build -KSeccompor something like this should work as it should.
I guess inside the lakefile.lean I can work with meta if, but how do I go about making the import and the Seccomp.enable line in Loogle.lean conditional?
Joachim Breitner (Jan 03 2024 at 17:48):
I gave it a shot on my own, and hacked something up by querying the environment variables in the lakefile and the actual code. Seems to work… :shrug: (https://github.com/nomeata/loogle/commit/b1751fc63f009f809ee7d7ab4b475b7284ffd395)
Last updated: May 02 2025 at 03:31 UTC