Skip to content

Commit d63846d

Browse files
committed
WIP: fix for builds on Alpine Linux
1 parent a47e7fd commit d63846d

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

code/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clan
5858
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s" )
5959
endif ()
6060

61+
# Check for Alpine Linux.
62+
if (UNIX AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.22.0")
63+
cmake_host_system_information(RESULT DIST_ID QUERY DISTRIB_ID)
64+
cmake_host_system_information(RESULT DIST_NAME QUERY DISTRIB_NAME)
65+
if (DIST_ID STREQUAL "alpine" OR DIST_NAME STREQUAL "Alpine Linux")
66+
# Alpine currently seems to have problems with Boost Process vs, so use v1.
67+
add_definitions (-DUSE_BOOST_PROCESS_V1=1)
68+
endif ()
69+
endif ()
70+
6171
set(CMAKE_CXX_STANDARD 17)
6272
set(CMAKE_CXX_STANDARD_REQUIRED ON)
6373

code/html_generation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <fstream>
2323
#include <iostream>
2424
#include <boost/version.hpp>
25-
#if BOOST_VERSION <= 108100
25+
#if (BOOST_VERSION <= 108100) || defined(USE_BOOST_PROCESS_V1)
2626
#include <boost/process.hpp>
2727
#else
2828
#include <boost/asio/io_context.hpp>
@@ -79,7 +79,7 @@ void openFirstIndexFile(const FolderMap& fm, const std::string& html_dir)
7979
// Open file via Boost Process.
8080
std::cout << "Opening " << fullFileName << " in browser ...\n";
8181
std::vector<std::string> params = additional_parameters(browser.value().type);
82-
#if BOOST_VERSION <= 108100
82+
#if (BOOST_VERSION <= 108100) || defined(USE_BOOST_PROCESS_V1)
8383
std::string command = browser.value().path.string();
8484
for (const auto& param: params)
8585
{

program-no-compression/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clan
6262
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s" )
6363
endif ()
6464

65+
# Check for Alpine Linux.
66+
if (UNIX AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.22.0")
67+
cmake_host_system_information(RESULT DIST_ID QUERY DISTRIB_ID)
68+
cmake_host_system_information(RESULT DIST_NAME QUERY DISTRIB_NAME)
69+
if (DIST_ID STREQUAL "alpine" OR DIST_NAME STREQUAL "Alpine Linux")
70+
# Alpine currently seems to have problems with Boost Process vs, so use v1.
71+
add_definitions (-DUSE_BOOST_PROCESS_V1=1)
72+
endif ()
73+
endif ()
74+
6575
add_executable(pmdb_no_comp ${pmdb_no_comp_sources})
6676

6777
# find libxml2

0 commit comments

Comments
 (0)