Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Core Modules
dune-common
Commits
a4fada60
Commit
a4fada60
authored
4 years ago
by
Simon Praetorius
Browse files
Options
Downloads
Patches
Plain Diff
Update AddQuadMathFlags to link to imported target
Move HAVE_QUADMATH and dune_register_package_flags to AddQuadMathFlags
parent
f18ce6b2
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!819
Rewrite FindQuadMath to provide imported targets
Pipeline
#27412
passed
4 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmake/modules/AddQuadMathFlags.cmake
+15
-11
15 additions, 11 deletions
cmake/modules/AddQuadMathFlags.cmake
cmake/modules/FindQuadMath.cmake
+4
-1
4 additions, 1 deletion
cmake/modules/FindQuadMath.cmake
with
19 additions
and
12 deletions
cmake/modules/AddQuadMathFlags.cmake
+
15
−
11
View file @
a4fada60
...
...
@@ -10,19 +10,23 @@
# A list of targets to use QuadMath with.
#
# set HAVE_QUADMATH for config.h
set
(
HAVE_QUADMATH
${
QuadMath_FOUND
}
)
# register the QuadMath imported target
if
(
QuadMath_FOUND
)
dune_register_package_flags
(
LIBRARIES QuadMath::QuadMath
COMPILE_DEFINITIONS
"ENABLE_QUADMATH=1"
)
endif
()
# add function to link against QuadMath::QuadMath
function
(
add_dune_quadmath_flags _targets
)
if
(
Q
UADMATH
_FOUND
)
if
(
Q
uadMath
_FOUND
)
foreach
(
_target
${
_targets
}
)
target_link_libraries
(
${
_target
}
"quadmath"
)
set_property
(
TARGET
${
_target
}
APPEND_STRING
PROPERTY COMPILE_FLAGS
"-DENABLE_QUADMATH=1 -D_GLIBCXX_USE_FLOAT128=1 "
)
if
(
${
CMAKE_CXX_COMPILER_ID
}
STREQUAL GNU
)
set_property
(
TARGET
${
_target
}
APPEND_STRING
PROPERTY COMPILE_FLAGS
"-fext-numeric-literals "
)
endif
()
target_link_libraries
(
${
_target
}
QuadMath::QuadMath
)
target_compile_definitions
(
${
_target
}
"ENABLE_QUADMATH=1"
)
endforeach
(
_target
${
_targets
}
)
endif
(
QUADMATH_FOUND
)
endif
()
endfunction
(
add_dune_quadmath_flags
)
This diff is collapsed.
Click to expand it.
cmake/modules/FindQuadMath.cmake
+
4
−
1
View file @
a4fada60
...
...
@@ -37,6 +37,9 @@ include(CheckCXXSourceCompiles)
include
(
CMakePushCheckState
)
cmake_push_check_state
()
set
(
CMAKE_REQUIRED_LIBRARIES quadmath
)
if
(
${
CMAKE_CXX_COMPILER_ID
}
STREQUAL GNU
)
set
(
CMAKE_REQUIRED_FLAGS
"-fext-numeric-literals"
)
endif
()
check_cxx_source_compiles
(
"
#include <quadmath.h>
...
...
@@ -57,7 +60,7 @@ endif()
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
QuadMath
DEFAULT_MSG
QuadMath_VAR
QuadMath_HEADER
QuadMath_COMPILES
QuadMath_VAR QuadMath_COMPILES
)
# add imported target for quadmath
...
...
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