From 1ae81075f4670bcda1023551ce40465bd88bbe39 Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Wed, 23 Aug 2023 21:25:19 +0200 Subject: [PATCH] Only enable -fno-omit-frame-pointer for static builds --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 50afcab4..ffc1ebe8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,9 +93,6 @@ elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") add_compile_options(-fcolor-diagnostics) endif() -# Strangely this is needed when linking statically against FLAC++ -add_compile_options(-fno-omit-frame-pointer) - if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") add_compile_options(/Zc:__cplusplus /utf-8 /wd4267 /wd4244 /wd5219) # Apply /MT or /MTd (multithread, static version of the run-time library) @@ -121,6 +118,9 @@ include(${CMAKE_SOURCE_DIR}/cmake/version.cmake) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules") if(STATIC_BUILD_DO_NOT_USE) + # Strangely this is needed when linking statically against FLAC++ + add_compile_options(-fno-omit-frame-pointer) + if(STATIC_BUILD_EXTRA_PREFIX) include_directories(BEFORE ${STATIC_BUILD_EXTRA_PREFIX}/include) set(CMAKE_PREFIX_PATH ${STATIC_BUILD_EXTRA_PREFIX})