Skip to content

Commit

Permalink
On GCC and CLANG use -fmacro-prefix-map
Browse files Browse the repository at this point in the history
and skip the C_FILE strrchr() mess which failed for windows anyway.
  • Loading branch information
chris2511 committed Oct 31, 2023
1 parent 41e46c1 commit 6704443
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ if (ADDRESS_SANITIZER)
add_compile_options(-fsanitize=address -O1 -fno-omit-frame-pointer -g)
set(ASAN_LIB -fsanitize=address)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES Clang|GNU)
add_compile_options(-fmacro-prefix-map=${PROJECT_SOURCE_DIR}=.)
endif()

file(GLOB UI_FILES ${CMAKE_AUTOUIC_SEARCH_PATHS}/*.ui)

Expand Down
2 changes: 1 addition & 1 deletion lib/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#define CCHAR(x) qPrintable(x)

#define C_FILE ((strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') : __FILE__- 1) + 1)
#define C_FILE __FILE__
#define TRACE qDebug("File: %s Func: %s Line: %d", C_FILE, __func__, __LINE__);

#define nativeSeparator(s) QDir::toNativeSeparators(s)
Expand Down

0 comments on commit 6704443

Please sign in to comment.