Skip to content

Commit 82e9722

Browse files
Merge pull request #142 from matyasselmeci/pr/el8
CMake and RPM changes to get EL8 builds working
2 parents 8c6c43e + 359551b commit 82e9722

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ if( NOT XROOTD_EXTERNAL_TINYXML2 )
8080
FetchContent_MakeAvailable( tinyxml2 )
8181
else()
8282
find_package( tinyxml2 REQUIRED )
83+
# tinyxml2 6.0.0 (EL8) provides the 'tinyxml2' target instead of the
84+
# 'tinyxml2::tinyxml2' target. If the former is found, define the latter.
85+
if( TARGET tinyxml2 )
86+
# Create an INTERFACE wrapper that links to the existing target
87+
add_library(tinyxml2::tinyxml2 INTERFACE IMPORTED)
88+
set_target_properties(tinyxml2::tinyxml2 PROPERTIES
89+
INTERFACE_LINK_LIBRARIES tinyxml2
90+
)
91+
endif()
8392
endif()
8493

8594
##
@@ -144,7 +153,7 @@ target_link_libraries(XrdOssHttp XrdHTTPServerObj XrdPelicanHttpCore)
144153
add_library( XrdOssFilterObj OBJECT src/Filter.cc src/logging.cc )
145154
set_target_properties( XrdOssFilterObj PROPERTIES POSITION_INDEPENDENT_CODE ON )
146155
target_include_directories( XrdOssFilterObj PRIVATE ${XRootD_INCLUDE_DIRS} )
147-
target_link_libraries( XrdOssFilterObj ${XRootD_UTILS_LIBRARIES} ${XRootD_SERVER_LIBRARIES} )
156+
target_link_libraries( XrdOssFilterObj ${XRootD_UTILS_LIBRARIES} ${XRootD_SERVER_LIBRARIES} std::filesystem)
148157

149158
add_library( XrdOssFilter MODULE "$<TARGET_OBJECTS:XrdOssFilterObj>" )
150159
target_link_libraries( XrdOssFilter XrdOssFilterObj )
@@ -165,7 +174,7 @@ target_link_libraries(XrdOssGlobus XrdOssGlobusObj XrdPelicanHttpCore)
165174
#######################
166175
add_library( XrdOssPoscObj OBJECT src/Posc.cc )
167176
set_target_properties( XrdOssPoscObj PROPERTIES POSITION_INDEPENDENT_CODE ON )
168-
target_link_libraries( XrdOssPoscObj XRootD::XrdServer XRootD::XrdUtils Threads::Threads std::atomic )
177+
target_link_libraries( XrdOssPoscObj XRootD::XrdServer XRootD::XrdUtils Threads::Threads std::atomic std::filesystem)
169178

170179
add_library( XrdOssPosc MODULE "$<TARGET_OBJECTS:XrdOssPoscObj>" )
171180
target_link_libraries( XrdOssPosc XrdOssPoscObj )

rpm/xrootd-s3-http.spec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@ Requires: xrootd-server < 1:%{xrootd_next_major}.0.0-1
3232
%prep
3333
%setup -q
3434

35+
%if 0%{?el8}
36+
# el8 does in-source builds by default; turn that off to match what newer ELs do
37+
%global __cmake_in_source_build %{nil}
38+
%endif
39+
3540
%build
3641
%cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DXROOTD_EXTERNAL_TINYXML2=ON
37-
cmake --build redhat-linux-build --verbose
42+
%cmake_build
3843

3944
%install
4045
%cmake_install

0 commit comments

Comments
 (0)