Skip to content
Snippets Groups Projects
Commit f100e409 authored by Pierre Aubert's avatar Pierre Aubert
Browse files

Add static lib compilation mode

parent a1f6df74
No related branches found
No related tags found
No related merge requests found
Pipeline #241741 passed
...@@ -29,6 +29,49 @@ dailyBuildMasterAll: ...@@ -29,6 +29,49 @@ dailyBuildMasterAll:
- tags - tags
tags: tags:
dailyBuildDynamicAndStatic:
image: gitlab-registry.in2p3.fr/cta-lapp/phoenix_libs/phoenixhdf5/hdf5:0.3
stage: BuildTestinstall
script:
- export LD_LIBRARY_PATH=/usr/lib
- env
- mkdir -p build
- cd build
- >
cmake ..
-DCMAKE_INSTALL_PREFIX=/usr
-DRELEASE_MODE=yes
-DSELF_TESTS_MODE=yes
-DPHOENIX_BUILD_TYPE=DynamicAndStatic
- make all
- make install
- make test
only:
- branches
- tags
tags:
dailyBuildStaticOnly:
image: gitlab-registry.in2p3.fr/cta-lapp/phoenix_libs/phoenixhdf5/hdf5:0.3
stage: BuildTestinstall
script:
- export LD_LIBRARY_PATH=/usr/lib
- env
- mkdir -p build
- cd build
- >
cmake ..
-DCMAKE_INSTALL_PREFIX=/usr
-DRELEASE_MODE=yes
-DSELF_TESTS_MODE=yes
-DPHOENIX_BUILD_TYPE=StaticOnly
- make all
- make install
- make test
only:
- branches
- tags
tags:
TestCoverage: TestCoverage:
image: gitlab-registry.in2p3.fr/cta-lapp/phoenix_libs/phoenixhdf5/hdf5:0.3 image: gitlab-registry.in2p3.fr/cta-lapp/phoenix_libs/phoenixhdf5/hdf5:0.3
......
...@@ -2,14 +2,25 @@ ...@@ -2,14 +2,25 @@
# Add Shared library with suffix by respect to the program version set with the phoenix_base_project function # Add Shared library with suffix by respect to the program version set with the phoenix_base_project function
# targetName : name of the library target to be created # targetName : name of the library target to be created
# ARGN : list of dependencies # ARGN : list of dependencies
# PHOENIX_BUILD_TYPE STREQUAL "StaticOnly" build al the project in static mode
# PHOENIX_BUILD_TYPE STREQUAL "DynamicAndStatic" build all the project in with dynamic and static libraries
function(phoenix_add_library targetName) function(phoenix_add_library targetName)
add_library(${targetName} SHARED ${ARGN}) if(PHOENIX_BUILD_TYPE STREQUAL "StaticOnly")
add_library(${targetName} STATIC ${ARGN})
else()
add_library(${targetName} SHARED ${ARGN})
string(REPLACE "." ";" PROGRAM_VERSION_LIST ${PROGRAM_VERSION}) string(REPLACE "." ";" PROGRAM_VERSION_LIST ${PROGRAM_VERSION})
list(GET PROGRAM_VERSION_LIST 0 PROGRAM_VERSION_SO) list(GET PROGRAM_VERSION_LIST 0 PROGRAM_VERSION_SO)
set_target_properties(${targetName} PROPERTIES set_target_properties(${targetName} PROPERTIES
VERSION "${PROGRAM_VERSION}" VERSION "${PROGRAM_VERSION}"
SOVERSION "${PROGRAM_VERSION_SO}") SOVERSION "${PROGRAM_VERSION_SO}")
if(PHOENIX_BUILD_TYPE STREQUAL "DynamicAndStatic")
add_library(${targetName}_static STATIC ${ARGN})
set_target_properties(${targetName}_static PROPERTIES OUTPUT_NAME ${targetName})
install(TARGETS ${targetName}_static LIBRARY DESTINATION ${LIBRARY_DIRECTORY} ARCHIVE DESTINATION ${LIBRARY_DIRECTORY})
endif()
endif()
endfunction(phoenix_add_library) endfunction(phoenix_add_library)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment