From 2cc07f0e73cd21fcb84b6ac79ea453fc4d491951 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 15 Jan 2024 23:33:31 +0100 Subject: [PATCH] build: Add option to not generate PDB files in release builds --- CMakeLists.txt | 1 + cmake/build_helpers.cmake | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0b7c9532..6be0e1f03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,7 @@ option(IMHEX_STRICT_WARNINGS "Enable most available warnings and treat them as e option(IMHEX_STATIC_LINK_PLUGINS "Statically link all plugins into the main executable" OFF) option(IMHEX_GENERATE_PACKAGE "Specify if a native package should be built. Only usable on Windows and MacOS" OFF) option(IMHEX_ENABLE_UNITY_BUILD "Enables building ImHex as a unity build." OFF) +option(IMHEX_GENERATE_PDBS "Enable generating PDB files in non-debug builds" ON) # Basic compiler and cmake configurations set(CMAKE_CXX_STANDARD 23) diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake index bee3fca4f..ad1acbde3 100644 --- a/cmake/build_helpers.cmake +++ b/cmake/build_helpers.cmake @@ -648,6 +648,10 @@ function(enableUnityBuild TARGET) endfunction() function(generatePDBs) + if (NOT IMHEX_GENERATE_PDBS) + return() + endif () + if (NOT WIN32 OR CMAKE_BUILD_TYPE STREQUAL "Debug") return() endif ()