C++ conditional compilation
Using g++ only
conditional.cpp
1 |
|
-DDEBUG args
1 | $ g++ -Wall -Wextra -Wconversion conditional.cpp -o conditional |
Using CMakeLists.txt add_definitions
1 | cmake_minimum_required(VERSION 3.2) |
without debug
1 | $ cmake .. |
with debug
1 | $ cmake -DDEBUG=ON .. |