Skip to content
Snippets Groups Projects
Commit 877087db authored by Atkins, Charles Vernon's avatar Atkins, Charles Vernon
Browse files

Fix how shared / static option is handled

parent 64d13b27
No related branches found
No related tags found
1 merge request!199Add cmake package configs
...@@ -55,14 +55,19 @@ include(CMakeDependentOption) ...@@ -55,14 +55,19 @@ include(CMakeDependentOption)
# Setup shared library / -fPIC stuff # Setup shared library / -fPIC stuff
get_property(SHARED_LIBS_SUPPORTED GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS) get_property(SHARED_LIBS_SUPPORTED GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
cmake_dependent_option(ADIOS2_BUILD_SHARED_LIBS option(BUILD_SHARED_LIBS "Build shared libraries (so/dylib/dll)." ${SHARED_LIBS_SUPPORTED})
"Whether or not to build shared libraries" ON if(NOT SHARED_LIBS_SUPPORTED)
"SHARED_LIBS_SUPPORTED" OFF) if(BUILD_SHARED_LIBS)
message(WARNING "A shared library build was requested but is not supported on this platform / compiler. Unexpected build results will likely occur")
endif()
set(BUILD_SHARED_LIBS OFF CACHE BOOL
"Build shared libraries (so/dylib/dll)." FORCE
)
endif()
cmake_dependent_option(ADIOS2_ENABLE_PIC cmake_dependent_option(ADIOS2_ENABLE_PIC
"Build with Position Independent Code" ON "Build with Position Independent Code" ON
"SHARED_LIBS_SUPPORTED" OFF) "SHARED_LIBS_SUPPORTED" OFF)
set(BUILD_SHARED_LIBS ${ADIOS2_BUILD_SHARED_LIBS})
if(ADIOS2_ENABLE_PIC) if(ADIOS2_ENABLE_PIC)
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif() endif()
......
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