From 9b680812457629b0a1b7a341621da88d8baed85d Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 13 Mar 2016 19:02:44 -0400 Subject: [PATCH] Only enable VERBOSE for debug builds. This can now be done with `make DEBUG=1`. --- Makefile | 8 +++++++- apple-ir-control.cc | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index de7c089..5b7e096 100644 --- 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) $< diff --git a/apple-ir-control.cc b/apple-ir-control.cc index fcb3f63..c92eb80 100644 --- a/apple-ir-control.cc +++ b/apple-ir-control.cc @@ -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) { \ -- 2.22.5