Skip to content

Commit

Permalink
CXXCBC-303: Fix RPM for RHEL 8
Browse files Browse the repository at this point in the history
  • Loading branch information
avsej committed Sep 25, 2024
1 parent af989ee commit 3de345f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
26 changes: 13 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,6 @@ include(cmake/OpenSSL.cmake)

include(cmake/VersionInfo.cmake)

include(cmake/DetectStandardFilesystem.cmake)
couchbase_cxx_check_filesystem(
couchbase_cxx_client
"filesystem"
"std::filesystem"
"stdc++fs;c++fs"
STD_FILESYSTEM)
if(STD_FILESYSTEM)
message(STATUS "Using std::filesystem")
else()
message(FATAL_ERROR "Couchbase C++ Client requires C++17, including an implementation of std::filesystem.")
endif()

add_subdirectory(core/platform)
set(couchbase_cxx_client_FILES
${CMAKE_CURRENT_BINARY_DIR}/generated/mozilla_ca_bundle.cxx
Expand Down Expand Up @@ -492,6 +479,19 @@ if(WIN32 OR NOT COUCHBASE_CXX_CLIENT_BUILD_SHARED)
endif()

foreach(TARGET ${couchbase_cxx_client_LIBRARIES})
include(cmake/DetectStandardFilesystem.cmake)
couchbase_cxx_check_filesystem(
${TARGET}
"filesystem"
"std::filesystem"
"stdc++fs;c++fs"
STD_FILESYSTEM)
if(STD_FILESYSTEM)
message(STATUS "Using std::filesystem")
else()
message(FATAL_ERROR "Couchbase C++ Client requires C++17, including an implementation of std::filesystem.")
endif()

set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)

target_include_directories(
Expand Down
1 change: 1 addition & 0 deletions cmake/Packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ if(COUCHBASE_CXX_CLIENT_RPM_TARGETS)

list(APPEND COUCHBASE_CXX_CLIENT_SUPPORTED_ROOTS
"rocky-9-${CMAKE_SYSTEM_PROCESSOR}"
"rocky-8-${CMAKE_SYSTEM_PROCESSOR}"
"amazonlinux-2023-${CMAKE_SYSTEM_PROCESSOR}"
)

Expand Down
11 changes: 11 additions & 0 deletions cmake/couchbase-cxx-client.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ Development files for the Couchbase C++ SDK.
%prep
%autosetup -p1 -n@COUCHBASE_CXX_CLIENT_TARBALL_NAME@
%cmake \
%if 0%{?rhel} == 8 || 0%{?rocky} == 8 || 0%{?ol} == 8
-S "." -B "redhat-linux-build" \
%endif
-DBUILD_SHARED_LIBS=OFF \
-DCOUCHBASE_CXX_CLIENT_INSTALL=ON \
-DCOUCHBASE_CXX_CLIENT_STATIC_BORINGSSL=ON \
Expand All @@ -44,10 +47,18 @@ Development files for the Couchbase C++ SDK.
-DCOUCHBASE_CXX_CLIENT_BUILD_SHARED=ON

%build
%if 0%{?rhel} == 8 || 0%{?rocky} == 8 || 0%{?ol} == 8
/usr/bin/cmake --build "redhat-linux-build" -j${RPM_BUILD_NCPUS} --verbose
%else
%cmake_build
%endif

%install
%if 0%{?rhel} == 8 || 0%{?rocky} == 8 || 0%{?ol} == 8
DESTDIR="%{buildroot}" /usr/bin/cmake --install "redhat-linux-build"
%else
%cmake_install
%endif

%files
%license %{_docdir}/couchbase_cxx_client/LICENSE.txt
Expand Down

0 comments on commit 3de345f

Please sign in to comment.