SPDX-License-Identifier: GPL-3.0-or-later SPDX-FileCopyrightText: 2022 Carles Fernandez-Prades --- CMakeLists.txt 2022-07-10 09:58:33.000000000 +0200 +++ CMakeLists.txt 2022-07-10 10:02:36.000000000 +0200 @@ -6,7 +6,7 @@ # Is dependend on by $GNSSTK/build.sh #============================================================ -cmake_minimum_required( VERSION 2.8.5 ) +cmake_minimum_required( VERSION 2.8.12 ) project( GNSSTK ) set( GNSSTK_VERSION_MAJOR "13" ) @@ -21,6 +21,15 @@ # This sets up variables contining GNU standard installation locations. include( GNUInstallDirs ) +if(POLICY CMP0063) + cmake_policy(SET CMP0063 NEW) + set(CMAKE_CXX_VISIBILITY_PRESET hidden) + set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) +else() + if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) + add_definitions(-fvisibility=hidden) + endif() +endif() # Set a filename for collecting exported targets. set( EXPORT_TARGETS_FILENAME "GNSSTKTargets" ) @@ -177,7 +186,7 @@ elseif( WIN32 ) add_library( gnsstk ${GNSSTK_SRC_FILES} ${GNSSTK_INC_FILES} ) else() - add_library( gnsstk SHARED ${GNSSTK_SRC_FILES} ${GNSSTK_INC_FILES} ) + add_library( gnsstk STATIC ${GNSSTK_SRC_FILES} ${GNSSTK_INC_FILES} ) endif() # always generate the header because it's an include file whose