mirror of
https://github.com/logos-blockchain/logos-blockchain-module.git
synced 2026-07-13 18:49:31 +00:00
Re-document and Nix integration with IDEs.
This commit is contained in:
parent
c12c46fd58
commit
3930ee416a
39
CONTRIBUTING.md
Normal file
39
CONTRIBUTING.md
Normal file
@ -0,0 +1,39 @@
|
||||
# Contributing
|
||||
|
||||
## Nix + IDE Integration
|
||||
|
||||
If your IDE reports that a file doesn't belong to the project or that files cannot be found, the CMake cache is likely
|
||||
missing the Nix-provided paths.
|
||||
|
||||
This may happen when the IDE runs CMake on its own, outside the Nix environment, leaving the required paths empty.
|
||||
|
||||
#### Preferred fix: launch the IDE from inside the Nix dev shell
|
||||
|
||||
This makes the IDE inherit required environment variables directly, so every CMake reload it triggers has the right
|
||||
environment, not just a one-off cache snapshot.
|
||||
|
||||
Example:
|
||||
```bash
|
||||
nix develop -c ...
|
||||
```
|
||||
|
||||
Or, if you're using CLion, there's already a shortcut for that:
|
||||
```bash
|
||||
just clion
|
||||
```
|
||||
|
||||
#### Alternative: regenerate the cache, then reload without resetting it
|
||||
|
||||
If you don't want to launch the IDE from inside the Nix dev shell, you can try to reuse an existing `CMakeCache.txt` on
|
||||
reload instead of always re-running `cmake` with its own environment.
|
||||
|
||||
To do that, you first need to regenerate the cache. This can be done by running:
|
||||
```bash
|
||||
nix develop -c just configure
|
||||
```
|
||||
|
||||
Then reload the CMake project without resetting the cache (resetting it would wipe the paths you just wrote):
|
||||
|
||||
> JetBrains: **View → Tool Windows → CMake** → **Reload** ↺
|
||||
|
||||
This won't help on an IDE that always re-invokes `cmake` with its own (non-Nix) environment on reload.
|
||||
4
justfile
4
justfile
@ -17,6 +17,10 @@ rebuild: clean build
|
||||
nix:
|
||||
nix develop
|
||||
|
||||
# Launch CLion inside the Nix dev shell so it inherits required variables and fully integrates with Nix.
|
||||
clion:
|
||||
nix develop -c "$HOME/.local/share/JetBrains/Toolbox/apps/clion/bin/clion.sh" . >/dev/null 2>&1 &
|
||||
|
||||
prettify:
|
||||
nix shell nixpkgs#clang-tools -c clang-format -i src/**.cpp src/**.h
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user