Skip to content

Commit

Permalink
replaced v2 .ipp with lib.
Browse files Browse the repository at this point in the history
  • Loading branch information
klemens-morgenstern committed Jun 4, 2024
1 parent 4bce309 commit 6cc7892
Show file tree
Hide file tree
Showing 45 changed files with 111 additions and 290 deletions.
35 changes: 32 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,31 @@ cmake_minimum_required(VERSION 3.5...3.16)

project(boost_process VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)

add_library(boost_process INTERFACE)
add_library(boost_process
src/detail/environment_posix.cpp
src/detail/environment_win.cpp
src/detail/last_error.cpp
src/detail/process_handle_windows.cpp
src/detail/throw_error.cpp
src/detail/utf8.cpp
src/ext/cmd.cpp
src/ext/cwd.cpp
src/ext/env.cpp
src/ext/exe.cpp
src/ext/proc_info.cpp
src/posix/close_handles.cpp
src/windows/default_launcher.cpp
src/environment.cpp
src/error.cpp
src/pid.cpp
src/process_handle.cpp
src/shell.cpp)

add_library(Boost::process ALIAS boost_process)

target_include_directories(boost_process INTERFACE include)
target_include_directories(boost_process PUBLIC include)
target_link_libraries(boost_process
INTERFACE
PUBLIC
Boost::algorithm
Boost::asio
Boost::config
Expand All @@ -28,6 +47,16 @@ target_link_libraries(boost_process
Boost::winapi
)

target_compile_definitions(boost_process
PRIVATE BOOST_PROCESS_SOURCE=1
)

if(BUILD_SHARED_LIBS)
target_compile_definitions(boost_process PUBLIC BOOST_PROCESS_DYN_LINK)
else()
target_compile_definitions(boost_process PUBLIC BOOST_PROCESS_STATIC_LINK)
endif()

if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")

add_subdirectory(test)
Expand Down
50 changes: 50 additions & 0 deletions build/Jamfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright (c) 2024 Klemens D. Morgenstern
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

import os ;
import feature ;
import ../../config/checks/config : requires ;

project : requirements
<define>BOOST_ASIO_NO_DEPRECATED
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
<toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
<toolset>msvc:<cxxflags>/bigobj
<target-os>windows:<define>WIN32_LEAN_AND_MEAN
<target-os>linux:<linkflags>-lpthread
: source-location ../src
;

alias process_sources
: detail/environment_posix.cpp
detail/environment_win.cpp
detail/last_error.cpp
detail/process_handle_windows.cpp
detail/throw_error.cpp
detail/utf8.cpp
ext/cmd.cpp
ext/cwd.cpp
ext/env.cpp
ext/exe.cpp
ext/proc_info.cpp
posix/close_handles.cpp
windows/default_launcher.cpp
environment.cpp
error.cpp
pid.cpp
process_handle.cpp
shell.cpp
;

lib boost_process
: process_sources
: requirements <define>BOOST_PROCESS_SOURCE=1
<link>shared:<define>BOOST_PROCESS_DYN_LINK=1
: usage-requirements
<link>shared:<define>BOOST_PROCESS_DYN_LINK=1

;

boost-install boost_process ;
3 changes: 0 additions & 3 deletions include/boost/process/v2/default_launcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,5 @@ typedef posix::default_launcher default_process_launcher;

BOOST_PROCESS_V2_END_NAMESPACE

#if defined(BOOST_PROCESS_V2_HEADER_ONLY)
#include <boost/process/v2/impl/default_launcher.ipp>
#endif

#endif //BOOST_PROCESS_V2_DEFAULT_LAUNCHER_HPP
16 changes: 6 additions & 10 deletions include/boost/process/v2/detail/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,14 @@ namespace filesystem = boost::filesystem;

BOOST_PROCESS_V2_END_NAMESPACE

#ifndef BOOST_PROCESS_V2_HEADER_ONLY
# ifndef BOOST_PROCESS_V2_SEPARATE_COMPILATION
# define BOOST_PROCESS_V2_HEADER_ONLY 1
# endif
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_PROCESS_V2_DYN_LINK)
#if defined(BOOST_PROCESS_V2_SOURCE)
#define BOOST_PROCESS_V2_DECL BOOST_SYMBOL_EXPORT
#else
#define BOOST_PROCESS_V2_DECL BOOST_SYMBOL_IMPORT
#endif

#if BOOST_PROCESS_V2_DOXYGEN
# define BOOST_PROCESS_V2_DECL
#elif defined(BOOST_PROCESS_V2_HEADER_ONLY)
# define BOOST_PROCESS_V2_DECL inline
#else
# define BOOST_PROCESS_V2_DECL
#define BOOST_PROCESS_V2_DECL
#endif

#if defined(BOOST_PROCESS_V2_POSIX)
Expand Down
18 changes: 0 additions & 18 deletions include/boost/process/v2/detail/impl/environment.ipp

This file was deleted.

6 changes: 0 additions & 6 deletions include/boost/process/v2/detail/last_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,5 @@ BOOST_PROCESS_V2_DECL error_code get_last_error();

BOOST_PROCESS_V2_END_NAMESPACE

#if defined(BOOST_PROCESS_V2_HEADER_ONLY)

#include <boost/process/v2/detail/impl/last_error.ipp>

#endif


#endif //BOOST_PROCESS_V2_DETAIL_LAST_ERROR_HPP
2 changes: 0 additions & 2 deletions include/boost/process/v2/detail/process_handle_windows.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,7 @@ struct basic_process_handle_win
};
};

#if !defined(BOOST_PROCESS_V2_HEADER_ONLY)
extern template struct basic_process_handle_win<>;
#endif

}

Expand Down
5 changes: 0 additions & 5 deletions include/boost/process/v2/detail/throw_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,5 @@ inline void throw_error(const error_code& err, const char* location)
}
BOOST_PROCESS_V2_END_NAMESPACE

#if defined(BOOST_PROCESS_V2_HEADER_ONLY)

#include <boost/process/v2/detail/impl/throw_error.ipp>

#endif

#endif //BOOST_PROCESS_V2_DETAIL_THROW_ERROR_HPP
6 changes: 0 additions & 6 deletions include/boost/process/v2/detail/utf8.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,5 @@ std::basic_string<CharOut, Traits, Allocator> conv_string(

BOOST_PROCESS_V2_END_NAMESPACE

#if defined(BOOST_PROCESS_V2_HEADER_ONLY)

#include <boost/process/v2/detail/impl/utf8.ipp>

#endif


#endif //BOOST_PROCESS_V2_DETAIL_UTF8_HPP
8 changes: 0 additions & 8 deletions include/boost/process/v2/environment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1888,12 +1888,4 @@ struct hash<BOOST_PROCESS_V2_NAMESPACE::environment::key_value_pair>
}



#if defined(BOOST_PROCESS_V2_HEADER_ONLY)

#include <boost/process/v2/impl/environment.ipp>
#include <boost/process/v2/detail/impl/environment.ipp>

#endif

#endif //BOOST_PROCESS_V2_ENVIRONMENT_HPP
6 changes: 0 additions & 6 deletions include/boost/process/v2/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,4 @@ static const error_category& exit_code_category = get_exit_code_category();

BOOST_PROCESS_V2_END_NAMESPACE

#if defined(BOOST_PROCESS_V2_HEADER_ONLY)

#include <boost/process/v2/impl/error.ipp>

#endif

#endif //BOOST_PROCESS_V2_ERROR_HPP
6 changes: 0 additions & 6 deletions include/boost/process/v2/ext/cmd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,5 @@ BOOST_PROCESS_V2_DECL shell cmd(basic_process_handle<Executor> & handle)

BOOST_PROCESS_V2_END_NAMESPACE

#if defined(BOOST_PROCESS_V2_HEADER_ONLY)

#include <boost/process/v2/ext/impl/cmd.ipp>

#endif


#endif // BOOST_PROCESS_V2_CMD_HPP
7 changes: 2 additions & 5 deletions include/boost/process/v2/ext/cwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
#define BOOST_PROCESS_V2_CWD_HPP

#include <boost/process/v2/detail/config.hpp>
#include <boost/process/v2/detail/throw_error.hpp>

#include <boost/process/v2/detail/throw_error.hpp>
#include <boost/process/v2/pid.hpp>
#include <boost/process/v2/process_handle.hpp>

BOOST_PROCESS_V2_BEGIN_NAMESPACE

Expand Down Expand Up @@ -51,8 +52,4 @@ BOOST_PROCESS_V2_DECL filesystem::path cwd(basic_process_handle<Executor> & hand

BOOST_PROCESS_V2_END_NAMESPACE

#if defined(BOOST_PROCESS_V2_HEADER_ONLY)
#include <boost/process/v2/ext/impl/cwd.ipp>
#endif

#endif // BOOST_PROCESS_V2_CWD_HPP
6 changes: 0 additions & 6 deletions include/boost/process/v2/ext/detail/proc_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,5 @@ BOOST_PROCESS_V2_DECL HANDLE open_process_with_debug_privilege(boost::process::v

BOOST_PROCESS_V2_END_NAMESPACE

#if defined(BOOST_PROCESS_V2_HEADER_ONLY)

#include <boost/process/v2/ext/detail/impl/proc_info.ipp>

#endif

#endif // BOOST_PROCESS_V2_DETAIL_PROC_INFO_HPP

5 changes: 0 additions & 5 deletions include/boost/process/v2/ext/env.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,4 @@ BOOST_PROCESS_V2_DECL env_view env(basic_process_handle<Executor> & handle)

BOOST_PROCESS_V2_END_NAMESPACE

#if defined(BOOST_PROCESS_V2_HEADER_ONLY)

#include <boost/process/v2/ext/impl/env.ipp>

#endif
#endif // BOOST_PROCESS_V2_ENV_HPP
4 changes: 0 additions & 4 deletions include/boost/process/v2/ext/exe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,5 @@ filesystem::path exe(basic_process_handle<Executor> & handle)

BOOST_PROCESS_V2_END_NAMESPACE

#if defined(BOOST_PROCESS_V2_HEADER_ONLY)
#include <boost/process/v2/ext/impl/exe.ipp>
#endif

#endif // BOOST_PROCESS_V2_EXE_HPP

24 changes: 0 additions & 24 deletions include/boost/process/v2/impl/default_launcher.ipp

This file was deleted.

3 changes: 0 additions & 3 deletions include/boost/process/v2/pid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ BOOST_PROCESS_V2_DECL std::vector<pid_type> child_pids(pid_type pid);

BOOST_PROCESS_V2_END_NAMESPACE

#if defined(BOOST_PROCESS_V2_HEADER_ONLY)
#include <boost/process/v2/impl/pid.ipp>
#endif

#endif // BOOST_PROCESS_V2_PID_HPP

9 changes: 0 additions & 9 deletions include/boost/process/v2/process_handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,4 @@ using process_handle = basic_process_handle<>;

BOOST_PROCESS_V2_END_NAMESPACE

#if defined(BOOST_PROCESS_V2_HEADER_ONLY)

#include <boost/process/v2/impl/process_handle.ipp>

#endif




#endif //BOOST_PROCESS_V2_PROCESS_HANDLE_HPP
6 changes: 0 additions & 6 deletions include/boost/process/v2/shell.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,4 @@ struct shell

BOOST_PROCESS_V2_END_NAMESPACE

#if defined(BOOST_PROCESS_V2_HEADER_ONLY)

#include <boost/process/v2/impl/shell.ipp>

#endif

#endif //BOOST_PROCESS_V2_ERROR_HPP
32 changes: 0 additions & 32 deletions include/boost/process/v2/src.hpp

This file was deleted.

4 changes: 1 addition & 3 deletions include/boost/process/v2/windows/default_launcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,6 @@ struct default_launcher
}
BOOST_PROCESS_V2_END_NAMESPACE

#if defined(BOOST_PROCESS_V2_HEADER_ONLY)
#include <boost/process/v2/windows/impl/default_launcher.ipp>
#endif


#endif //BOOST_PROCESS_V2_WINDOWS_DEFAULT_LAUNCHER_HPP
Loading

0 comments on commit 6cc7892

Please sign in to comment.