mirror of
https://github.com/wiiu-env/EnvironmentLoader.git
synced 2024-10-31 20:55:04 +01:00
Only do logging when building with make DEBUG=1
This commit is contained in:
parent
86f124baaa
commit
6cbe000c49
5
Makefile
5
Makefile
@ -38,6 +38,11 @@ CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__
|
||||
|
||||
CXXFLAGS := $(CFLAGS) -std=c++20
|
||||
|
||||
ifeq ($(DEBUG),1)
|
||||
CXXFLAGS += -DDEBUG -g
|
||||
CCFLAGS += -DDEBUG -g
|
||||
endif
|
||||
|
||||
ASFLAGS := -g $(ARCH)
|
||||
LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map)
|
||||
|
||||
|
@ -55,10 +55,12 @@ extern "C" uint32_t textStart();
|
||||
std::string EnvironmentSelectionScreen(const std::map<std::string, std::string> &payloads);
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
#ifdef DEBUG
|
||||
if (!WHBLogModuleInit()) {
|
||||
WHBLogCafeInit();
|
||||
WHBLogUdpInit();
|
||||
}
|
||||
#endif // DEBUG
|
||||
|
||||
DEBUG_FUNCTION_LINE("Hello from EnvironmentLoader!");
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
#define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
|
||||
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__)
|
||||
|
||||
@ -18,6 +20,14 @@ extern "C" {
|
||||
WHBLogWritef("[%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
|
||||
#define DEBUG_FUNCTION_LINE(FMT, ARGS...) while (0)
|
||||
|
||||
#define DEBUG_FUNCTION_LINE_WRITE(FMT, ARGS...) while (0)
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user