Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ option(BUILD_SHARED_LIBS "Build shared libraries instead of static libraries" ON
option(VISP_VULKAN "Enable Vulkan support" OFF)
option(VISP_DEV "Enable development mode" OFF)
option(VISP_CI "Enable for continuous integration environment" OFF)
option(VISP_PACKAGE "Build for packaging and distribution" OFF)
option(VISP_TESTS "Build tests" ${PROJECT_IS_TOP_LEVEL})
option(VISP_INSTALL_MODELS "Download and install default models" OFF)
option(VISP_INSTALL_MODELS "Download and install default models" ${VISP_PACKAGE})
option(VISP_FMT_LIB "Use external fmt library instead of standard C++ <format>" OFF)
option(VISP_STATIC_GGML "Force static build of ggml" OFF)
option(VISP_ASAN "Enable AddressSanitizer" OFF)
Expand All @@ -25,6 +26,10 @@ if(PROJECT_IS_TOP_LEVEL)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
if (VISP_PACKAGE)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
endif()
endif()

# Set default build type to Release (except for multi-config generators)
Expand Down Expand Up @@ -76,6 +81,9 @@ elseif(UNIX AND NOT APPLE)
# Disable omitting dependencies from ELF binaries so they can be found via RPATH
list(APPEND VISP_LINK_OPTIONS -Wl,--no-as-needed)
endif()
if(VISP_PACKAGE)
list(APPEND VISP_LINK_OPTIONS -Wl,--exclude-libs,ALL)
endif()
endif()

# Configure warnings
Expand Down
2 changes: 1 addition & 1 deletion scripts/pkg-check/check-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ step1() {
-D VISP_VULKAN=OFF \
-D VISP_TESTS=OFF \
-D VISP_STATIC_GGML=ON \
-D VISP_INSTALL_MODELS=ON
-D VISP_PACKAGE=ON

cmake --build "$SRC_BUILD_DIR"

Expand Down
2 changes: 1 addition & 1 deletion src/visp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ set_target_properties(visioncpp PROPERTIES
SOVERSION ${PROJECT_VERSION_MAJOR}
)

if (MSVC AND VISP_TESTS)
if (MSVC AND VISP_TESTS AND NOT VISP_PACKAGE)
set_target_properties(visioncpp PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
4 changes: 4 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ target_compile_options(vision-workbench PRIVATE ${VISP_COMP_OPTIONS})
target_link_options(vision-workbench PRIVATE ${VISP_LINK_OPTIONS})
target_link_libraries(vision-workbench PRIVATE visioncpp ggml ${VISP_FMT_LINK})

if(VISP_PACKAGE)
message(WARNING "Some tests may not work due to symbol visibility settings for packaging. Use VISP_PACKAGE=OFF to run all tests. Use VISP_TESTS=OFF when packaging.")
endif()

#
# Python tests

Expand Down
Loading