[AD] Patch for Cmake profiling build with gcc |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Attached is a patch to fix the profiling build for allegro with gcc. It
currently fails with undefined references to mcount. I added in
CMAKE_SHARED_LINKER_FLAGS_PROFILE to '-pg' in the profiiling section and
added that flag to the 'mark_as_advanced' field just below. I don't know
what the 'mark_as_advanced' field does but that follows the same pattern
as the other flags. With the patch it now correctly builds on Windows.
Untested on other platforms but -pg should work with gcc everywhere.
--- CMakeLists.txt 2014-05-18 17:13:27.564607500 -0500
+++ CMakeLists.txt.new 2014-05-18 17:08:58.002759000 -0500
@@ -400,10 +400,13 @@
CACHE STRING "profiling flags")
set(CMAKE_EXE_LINKER_FLAGS_PROFILE "-pg"
CACHE STRING "profiling flags")
+ set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "-pg"
+ CACHE STRING "profiling flags")
mark_as_advanced(
CMAKE_C_FLAGS_PROFILE
CMAKE_CXX_FLAGS_PROFILE
CMAKE_EXE_LINKER_FLAGS_PROFILE
+ CMAKE_SHARED_LINKER_FLAGS_PROFILE
)
endif(COMPILER_GCC_OR_CLANG)