Skip to content

Commit

Permalink
Hide dependent library symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
acpaquette committed Jul 18, 2024
1 parent cf8984f commit b90d2bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ message(STATUS "CMake Module Path: " ${CMAKE_MODULE_PATH})

include(GNUInstallDirs)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)

# Set a default build type if none was specified
set(default_build_type "Release")
Expand All @@ -17,6 +17,8 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
STRING "Choose the type of build." FORCE)
endif()

set(VISIBILITY_INLINES_HIDDEN 1)

# Use external or embedded dependencies
option(USGSCSM_EXTERNAL_DEPS "If the library should be built with external or embedded dependencies" OFF)
option(ENABLE_CURL "Set to build the curl components of proj" OFF)
Expand Down Expand Up @@ -166,7 +168,7 @@ else()

# default config is shared
option(BUILD_SHARED_LIBS
"Build PROJ library shared." ON)
"Build PROJ library shared." OFF)

find_package(Threads QUIET)
if(Threads_FOUND AND CMAKE_USE_PTHREADS_INIT)
Expand Down Expand Up @@ -522,7 +524,6 @@ else()
${ALL_LIBPROJ_HEADERS}
${PROJ_RESOURCES}
)
add_library(PROJ::proj ALIAS proj)

if(MSVC OR MINGW)
target_compile_definitions(proj PRIVATE -DNOMINMAX)
Expand Down Expand Up @@ -576,7 +577,9 @@ else()

set_target_properties(proj
PROPERTIES
LINKER_LANGUAGE CXX)
LINKER_LANGUAGE CXX
CXX_VISIBILITY_PRESET hidden
)

##############################################
# Link properties
Expand Down Expand Up @@ -634,6 +637,7 @@ else()
# ALE
# Use Eigen included with ALE
add_library (eigen INTERFACE)
set_target_properties(eigen PROPERTIES CXX_VISIBILITY_PRESET hidden)
add_library (Eigen3::Eigen ALIAS eigen)
target_include_directories (eigen INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/ale/eigen)
Expand All @@ -649,6 +653,7 @@ else()
${CMAKE_CURRENT_SOURCE_DIR}/ale/src/Vectors.cpp)

add_library(ale OBJECT ${ALE_SOURCE_FILES})
set_target_properties(ale PROPERTIES CXX_VISIBILITY_PRESET hidden)
set(ALE_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/ale/include/ale/")

target_include_directories(ale
Expand Down
4 changes: 3 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ add_executable(runCSMCameraModelTests
SarTests.cpp
ISDParsingTests.cpp
UtilitiesTests.cpp
EigenUtilitiesTests.cpp)
EigenUtilitiesTests.cpp
../ale/src/Rotation.cpp
../ale/src/InterpUtils.cpp)
if(WIN32)
option(CMAKE_USE_WIN32_THREADS_INIT "using WIN32 threads" ON)
option(gtest_disable_pthreads "Disable uses of pthreads in gtest." ON)
Expand Down

0 comments on commit b90d2bf

Please sign in to comment.