cgns: Add -fPIC to Fortan/C compilation flags (#39700)
* cgns: Add -fPIC to Fortan/C compilation flags This should fix #39699 * cgns: Add -fPIC compilation flags when +fortran Incorporating suggestions of @aumuell with addition of making +pic required when +fortran
This commit is contained in:
parent
5bc5139552
commit
743a93902d
1 changed files with 4 additions and 0 deletions
|
@ -46,6 +46,7 @@ class Cgns(CMakePackage):
|
|||
variant("legacy", default=False, description="Enable legacy options")
|
||||
variant("mem_debug", default=False, description="Enable memory debugging option")
|
||||
variant("tools", default=False, description="Enable CGNS tools")
|
||||
variant("pic", default=False, description="Produce position-independent code")
|
||||
|
||||
depends_on("cmake@3.12:", when="@4.3:", type="build")
|
||||
depends_on("cmake@3.8:", when="@4.2:", type="build")
|
||||
|
@ -62,6 +63,8 @@ class Cgns(CMakePackage):
|
|||
depends_on("libxmu", when="+tools")
|
||||
depends_on("libsm", when="+tools")
|
||||
|
||||
conflicts("~pic", when="+fortran", msg="+pic required when +fortran")
|
||||
|
||||
# patch for error undefined reference to `matherr, see
|
||||
# https://bugs.gentoo.org/662210
|
||||
patch("no-matherr.patch", when="@:3.3.1 +tools")
|
||||
|
@ -83,6 +86,7 @@ def cmake_args(self):
|
|||
self.define_from_variant("CGNS_ENABLE_BASE_SCOPE", "base_scope"),
|
||||
self.define_from_variant("CGNS_ENABLE_LEGACY", "legacy"),
|
||||
self.define_from_variant("CGNS_ENABLE_MEM_DEBUG", "mem_debug"),
|
||||
self.define_from_variant("CMAKE_POSITION_INDEPENDENT_CODE", "pic"),
|
||||
]
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue