diff --git a/CMakeLists.txt b/CMakeLists.txt index 49ac30b5db..22a62c19cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,9 +42,6 @@ project(hifi) include("cmake/init.cmake") include("cmake/compiler.cmake") -set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s") -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s") - add_paths_to_fixup_libs(${VCPKG_INSTALL_ROOT}/bin) add_paths_to_fixup_libs(${VCPKG_INSTALL_ROOT}/debug/bin) @@ -199,6 +196,15 @@ unset(JS_SRC) set_packaging_parameters() +if (PRODUCTION_BUILD) + if (APPLE) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-s") + elseif(UNIX) + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s") + endif() +endif() + # Locate the required Qt build on the filesystem setup_qt() list(APPEND CMAKE_PREFIX_PATH "${QT_CMAKE_PREFIX_PATH}")