title: Check in preprocessor that g++ is called with -fopenmp
body: <p>I have my code that uses OpenMP and I build it with <code>g++</code> like this:</p>
  
  <pre><code>g++ -std=c++17 -O3 -fopenmp main.cpp -o helloworld
  </code></pre>
  
  <p>Now, for debugging and testing purposes, I sometimes want to build the code without OpenMP with something like that:</p>
  
  <pre><code>g++ -std=c++17 -O3 main.cpp -o helloworld
  </code></pre>
  
  <p>The code will not build because OpenMP functions are not linked (<code>-fopenmp</code> is not used). So my idea was to use some preprocessor magic, something like that:</p>
  
  <pre><code>#ifdef OPENMP
  // run OpenMP-specific code
  #else
  // run this code only if -fopenmp was not set
  #endif
  </code></pre>
  
  <p>Is that possible? The problem might be that <code>-fopenmp</code> is only used for linking OpenMP library thus might be not known/used during preprocessor phase of build.</p>