Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ADIOS2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Podhorszki, Norbert
ADIOS2
Commits
ebddac74
Commit
ebddac74
authored
7 years ago
by
Atkins, Charles Vernon
Browse files
Options
Downloads
Patches
Plain Diff
Fix defaults for shared libs and fPIC
Fixes
#210
parent
95ac9f6d
No related branches found
No related tags found
1 merge request
!218
Fix shared libs default
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMakeLists.txt
+31
-19
31 additions, 19 deletions
CMakeLists.txt
with
31 additions
and
19 deletions
CMakeLists.txt
+
31
−
19
View file @
ebddac74
...
...
@@ -55,31 +55,40 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
include
(
CMakeDependentOption
)
# Setup shared library / -fPIC stuff
# Setup shared library defaults. If explicitly specified somehow, then default
# to that. Otherwise base the default on whether or not shared libs are even
# supported.
get_property
(
SHARED_LIBS_SUPPORTED GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS
)
if
(
DEFINED BUILD_SHARED_LIBS
)
set
(
ADIOS2_BUILD_SHARED_LIBS_DEFAULT
${
BUILD_SHARED_LIBS
}
)
elseif
(
DEFINED ADIOS2_BUILD_SHARED_LIBS
)
if
(
DEFINED ADIOS2_BUILD_SHARED_LIBS
)
set
(
ADIOS2_BUILD_SHARED_LIBS_DEFAULT
${
ADIOS2_BUILD_SHARED_LIBS
}
)
elseif
(
DEFINED BUILD_SHARED_LIBS
)
set
(
ADIOS2_BUILD_SHARED_LIBS_DEFAULT
${
BUILD_SHARED_LIBS
}
)
else
()
set
(
ADIOS2_BUILD_SHARED_LIBS_DEFAULT
${
SHARED_LIBS_SUPPORTED
}
)
endif
()
unset
(
BUILD_SHARED_LIBS
)
option
(
ADIOS2_BUILD_SHARED_LIBS
"Build shared libraries (so/dylib/dll)."
${
ADIOS2_BUILD_SHARED_LIBS
}
)
cmake_dependent_option
(
ADIOS2_BUILD_SHARED_LIBS
"Build shared libraries (so/dylib/dll)."
${
ADIOS2_BUILD_SHARED_LIBS_DEFAULT
}
"SHARED_LIBS_SUPPORTED"
OFF
)
set
(
BUILD_SHARED_LIBS
${
ADIOS2_BUILD_SHARED_LIBS
}
)
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
)
mark_as_advanced
(
BUILD_SHARED_LIBS
)
# Setup PIC defaults. If explicitly specified somehow, then default
# to that. Otherwise base the default on whether or not shared libs are even
# supported.
if
(
DEFINED ADIOS2_ENABLE_PIC
)
set
(
ADIOS2_ENABLE_PIC_DEFAULT
${
ADIOS2_ENABLE_PIC
}
)
elseif
(
DEFINED CMAKE_POSITION_INDEPENDENT_CODE
)
set
(
ADIOS2_ENABLE_PIC_DEFAULT
${
CMAKE_POSITION_INDEPENDENT_CODE
}
)
else
()
set
(
ADIOS2_ENABLE_PIC_DEFAULT
${
SHARED_LIBS_SUPPORTED
}
)
endif
()
cmake_dependent_option
(
ADIOS2_ENABLE_PIC
"Build with Position Independent Code"
ON
"SHARED_LIBS_SUPPORTED"
OFF
)
if
(
ADIOS2_ENABLE_PIC
)
set
(
CMAKE_POSITION_INDEPENDENT_CODE
ON
)
endif
(
)
"Build with Position Independent Code"
${
ADIOS2_ENABLE_PIC_DEFAULT
}
"SHARED_LIBS_SUPPORTED"
OFF
)
set
(
CMAKE_POSITION_INDEPENDENT_CODE
${
ADIOS2_ENABLE_PIC
}
)
mark_as_advanced
(
CMAKE_POSITION_INDEPENDENT_CODE
)
adios_option
(
BZip2
"Enable support for BZip2 transforms"
AUTO
)
adios_option
(
ZFP
"Enable support for ZFP transforms"
AUTO
)
...
...
@@ -162,10 +171,13 @@ message("")
message
(
" Installation prefix:
${
CMAKE_INSTALL_PREFIX
}
"
)
message
(
" Features:"
)
if
(
BUILD_SHARED_LIBS
)
message
(
" Library Type: shared"
)
set
(
msg_lib_type
"shared"
)
elseif
(
CMAKE_POSITION_INDEPENDENT_CODE
)
set
(
msg_lib_type
"static (with PIC)"
)
else
()
message
(
" Library T
ype
:
static"
)
set
(
msg_lib_t
ype
"
static
(without PIC)
"
)
endif
()
message
(
" Library Type:
${
msg_lib_type
}
"
)
message
(
" Build Type:
${
CMAKE_BUILD_TYPE
}
"
)
message
(
" Testing:
${
BUILD_TESTING
}
"
)
message
(
" Build Options:"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment