How to setup CLion to use waf as build system
Asked Answered
C

3

8

I am trying to configure my Intellij Clion IDE for working with ns-3. Since ns-3 is using waf, it is more tricky than i thought and would be really happy to hear any advice

Clapperclaw answered 29/4, 2016 at 15:5 Comment(1)
Please expand your question; what have you done so far? What have you tried? What went wrong? Have you read the Clion tutorials?Jazzman
P
4

CLion supports compilation databases for quite some while, which waf, luckily, is able to generate using the clang_compilation_database extension.

You'll need to load it within your configuration and option step; i.e. like this:

def options(ctx):
    # Assuming you just copied the script into a directory called tools
    ctx.load('clang_compilation_database', tooldir='tools')
    # ...

def configure(ctx):
    ctx.load('clang_compilation_database', tooldir='tools')
    # ...

Now you can call waf clangdb; you'll be presented a file called 'compile_commands.json' in your build directory.

Phago answered 2/7, 2020 at 21:20 Comment(1)
You'll probably need to download the clang_compilation_database.py script linked above and put it in your waf tools folder (which may be called something else in your case).Rawdin
F
1

CLion only uses cmake for its internal project definition - so you have to have a cmake config.

It can be very simple and mirror parts of another build system you actually use, but how CLion treats files and what it does when you tell it to build something is defined by cmake and only cmake.

Fact answered 1/5, 2016 at 8:25 Comment(0)
A
0

You could setup compilation databases as suggested by Julian or you could try my fork, if you don't mind using a not completely up-to-date fork of the upstream project. https://github.com/Gabrielcarvfer/NS3.

Visual Studio can also be used with CMake projects and WSL, but ClangCL/MSVC support is being worked on.

I plan on opening a MR to upstream the CMake support, but it is a lot of work to replace Waf completely.

Adust answered 22/10, 2020 at 21:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.