Skip to content
Discussion options

You must be logged in to vote

For small programs I keep a simple compile_flags.txt in my $HOME directory which just lists common search paths (I'm on macOS so I need to specify paths to boost etc.) and my usual compile flags. It looks like this:

-std=c++17
-Wall
-I/opt/homebrew/opt/boost/include
-I/opt/homebrew/include
-L/opt/homebrew/lib

For larger projects, I usually have a simple script which just runs cmake with -DCMAKE_EXPORT_COMPILE_COMMANDS=ON to generate compile_commands.json and then deletes the CMake cache.

Replies: 6 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@veranovus
Comment options

Answer selected by veranovus
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@AlexisTM
Comment options

@ky3ow
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
8 participants