Only enable VERBOSE for debug builds.
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 13 Mar 2016 23:02:44 +0000 (19:02 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 13 Mar 2016 23:02:44 +0000 (19:02 -0400)
This can now be done with `make DEBUG=1`.

Makefile
apple-ir-control.cc

index de7c08942c56019ec8e14d03dd675f60c7e18ce2..5b7e09608b996a261a7eaab401d8d2f872345d5d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,2 +1,8 @@
+CCFLAGS := -g -std=c++11 -Wall -framework CoreFoundation -framework IOKit
+
+ifndef DEBUG
+       CCFLAGS += -DNDEBUG
+endif
+
 apple-ir-control: apple-ir-control.cc
-       clang++ -o $@ -g -std=c++11 -Wall -framework CoreFoundation -framework IOKit $<
+       clang++ -o $@ $(CCFLAGS) $<
index fcb3f6343d27b5da8e5acba8c52209f0b2056a3f..c92eb8054dc4100245afb9e05417507dad7b54e9 100644 (file)
@@ -7,7 +7,11 @@
 const CFStringRef kPrefDomain = CFSTR("com.apple.driver.AppleIRController");
 const CFStringRef kPrefEnabled = CFSTR("DeviceEnabled");
 
+#if NDEBUG
+bool VERBOSE = false;
+#else
 bool VERBOSE = true;
+#endif
 
 #define LOG(msg, ...) do { \
     if (VERBOSE) { \