summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-10-08 03:15:57 +0200
committerSven Gothel <[email protected]>2020-10-08 03:15:57 +0200
commitf81e944bf2ee37bb1982ee53734690caf9216073 (patch)
tree5eff83f8010444a198e3ddb027088efc20eeca06 /CMakeLists.txt
parente6cc1698c5c6df512790162ea88cc515208bd481 (diff)
Shorten __FILE__ using gcc via '-fmacro-prefix-map=olddir=newdir' to reduce memory footprint
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aaa70b37..468e97d0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,11 @@ PKG_CHECK_MODULES (GIO-UNIX REQUIRED gio-unix-2.0>=2.40)
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -fno-omit-frame-pointer -DDEBUG")
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Wextra -O3")
+IF(CMAKE_COMPILER_IS_GNUCC)
+ # shorten __FILE__ string and the like ..
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmacro-prefix-map=${CMAKE_SOURCE_DIR}/=/")
+ENDIF(CMAKE_COMPILER_IS_GNUCC)
+
# '-latomic' is required using gcc-8 on Raspberry ... to avoid: undefined reference to `__atomic_store_8'
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -latomic")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -latomic")