Skip to content

Commit 4840817

Browse files
committed
Added option to turn off debugging symbols
1 parent 302553e commit 4840817

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ include(CheckCXXCompilerFlag)
88
option(BUILD_STUDIO_APP "Build Studio application" ON)
99
option(BUILD_GUILE_BINDINGS "Build Guile bindings" ON)
1010
option(BUILD_PYTHON_BINDINGS "Build Python bindings" ON)
11+
option(ENABLE_DEBUG "Add debugging Symbols to the binaries" ON)
1112

1213
option(LIBFIVE_PACKED_OPCODES
1314
"Tightly pack opcodes (breaks compatibility with older saved f-reps)"
@@ -47,8 +48,14 @@ endif()
4748

4849
################################################################################
4950

51+
if(ENABLE_DEBUG)
52+
set(LIBFIVE_DEBUGGING "-g ")
53+
else()
54+
set(LIBFIVE_DEBUGGING "")
55+
endif()
56+
5057
if(NOT MSVC)
51-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -g -fPIC -pedantic -Werror=switch")
58+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra ${LIBFIVE_DEBUGGING}-fPIC -pedantic -Werror=switch")
5259

5360
# Sometimes this flag is not supported (e.g. on Apple Silicon)
5461
check_cxx_compiler_flag("-march=native" MARCH_SUPPORTED)

0 commit comments

Comments
 (0)