Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

Commit 9c6f117b authored by Artur Grunau's avatar Artur Grunau
Browse files

Replace CAMPVIS_SHARED_LIBS with BUILD_SHARED_LIBS

CAMPVis used a custom option, CAMPVIS_SHARED_LIBS, to determine whether
shared or static libraries should be built. This option partially
duplicated the functionality of one of CMake's standard flags,
BUILD_SHARED_LIBS. The two could get out of sync, and because CMake only
consults BUILD_SHARED_LIBS when deciding how to build a library target,
it was possible to get inconsistent and broken build configurations.

To prevent that, add BUILD_SHARED_LIBS as an option to CAMPVis' main
CMakeLists and replace all references to CAMPVIS_SHARED_LIBS with
BUILD_SHARED_LIBS. This makes BUILD_SHARED_LIBS the only flag that
controls whether shared or static libraries are built.

References #367
parent 340c443b
......@@ -10,7 +10,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
# Global Build Options
#
OPTION(CAMPVIS_SHARED_LIBS "Build shared libraries?" ON)
OPTION(BUILD_SHARED_LIBS "Build shared libraries?" ON)
#OPTION(CAMPVIS_PRECOMPILED_HEADER "Use pre-compiled headers?" ON)
OPTION(CAMPVIS_DEBUG "Activate debug code?" ON)
OPTION(CAMPVIS_BUILD_APPLICATION "Build CAMPVis Application" ON)
......
......@@ -110,7 +110,7 @@ IF(WIN32)
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LARGEADDRESSAWARE")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
IF(CAMPVIS_SHARED_LIBS)
IF(BUILD_SHARED_LIBS)
# Linking against Windows DLLs requires explicit instantiation of templates
LIST(APPEND CampvisGlobalDefinitions "-DDLL_TEMPLATE_INST")
LIST(APPEND CampvisGlobalDefinitions "-DCAMPVIS_DYNAMIC_LIBS")
......
......@@ -5,11 +5,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
MESSAGE(STATUS "Configuring CAMPVis Core")
# configuration
IF(CAMPVIS_SHARED_LIBS)
SET(BUILD_SHARED_LIBS TRUE)
IF(MSVC)
ADD_DEFINITIONS("-DCAMPVIS_CORE_BUILD_DLL")
ENDIF()
IF(BUILD_SHARED_LIBS AND MSVC)
ADD_DEFINITIONS("-DCAMPVIS_CORE_BUILD_DLL")
ENDIF()
# glob sources from core directories
......@@ -62,4 +59,4 @@ TARGET_LINK_LIBRARIES(campvis-core tgt ${CampvisGlobalExternalLibs})
IF(CAMPVIS_GROUP_SOURCE_FILES)
DEFINE_SOURCE_GROUPS_FROM_SUBDIR(CampvisCoreSources ${CampvisHome} "")
DEFINE_SOURCE_GROUPS_FROM_SUBDIR(CampvisCoreHeaders ${CampvisHome} "")
ENDIF()
\ No newline at end of file
ENDIF()
......@@ -14,11 +14,8 @@ IF(TGT_WITH_WMI)
LIST(APPEND CampvisGlobalExternalLibs "WbemUuid")
ENDIF(TGT_WITH_WMI)
IF(CAMPVIS_SHARED_LIBS)
SET(BUILD_SHARED_LIBS TRUE)
IF(MSVC)
ADD_DEFINITIONS("-DTGT_BUILD_DLL")
ENDIF()
IF(BUILD_SHARED_LIBS AND MSVC)
ADD_DEFINITIONS("-DTGT_BUILD_DLL")
ENDIF()
......
......@@ -17,7 +17,7 @@ LIST(APPEND CampvisModulesSources
LINK_DIRECTORIES(${CampvisGlobalLinkDirectories} ${CampvisModulesLinkDirectories})
ADD_LIBRARY(campvis-modules
ADD_LIBRARY(campvis-modules STATIC
${CampvisModulesSources} ${CampvisModulesHeaders}
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment