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)
# Setup shared library / -fPIC stuff
get_property(SHARED_LIBS_SUPPORTED GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
cmake_dependent_option(ADIOS2_BUILD_SHARED_LIBS
"Whether or not to build shared libraries" ON
"SHARED_LIBS_SUPPORTED" OFF)
option(BUILD_SHARED_LIBS "Build shared libraries (so/dylib/dll)." ${SHARED_LIBS_SUPPORTED})
if(NOT SHARED_LIBS_SUPPORTED)
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
"Build with Position Independent Code" ON
"SHARED_LIBS_SUPPORTED" OFF)
set(BUILD_SHARED_LIBS ${ADIOS2_BUILD_SHARED_LIBS})
if(ADIOS2_ENABLE_PIC)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
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