Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 7 additions & 26 deletions cpp/thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,40 +66,21 @@ endif()

# ## BOOST
if(MEMILIO_USE_BUNDLED_BOOST)
message(STATUS "Downloading Boost library. This may take several minutes. This is the time to get yourself a coffee. :-)")
message(STATUS "Downloading Boost library")

string(REPLACE "." "_" MEMILIO_BOOST_VERSION_UNDERSC "${MEMILIO_BOOST_VERSION}")

include(FetchContent)
FetchContent_Declare(boost
GIT_REPOSITORY https://github.com/boostorg/boost.git
GIT_TAG boost-${MEMILIO_BOOST_VERSION})
#don't use the URL from github, that download isn't complete and requires more setup (subrepositories, bootstrapping)
URL https://archives.boost.io/release/${MEMILIO_BOOST_VERSION}/source/boost_${MEMILIO_BOOST_VERSION_UNDERSC}.tar.gz
)
FetchContent_GetProperties(boost)

if(NOT boost_POPULATED)
FetchContent_Populate(boost)
endif()

add_custom_target(boost-bootstrap ALL
DEPENDS "${boost_SOURCE_DIR}/boost"
)

if(MSVC)
add_custom_command(
OUTPUT "${boost_SOURCE_DIR}/boost"
COMMAND "bootstrap.bat"
COMMAND "b2.exe" headers
WORKING_DIRECTORY ${boost_SOURCE_DIR}
VERBATIM
)
else()
add_custom_command(
OUTPUT "${boost_SOURCE_DIR}/boost"
COMMAND ./bootstrap.sh
COMMAND ./b2 headers
WORKING_DIRECTORY ${boost_SOURCE_DIR}
VERBATIM
)
endif()


add_library(boost INTERFACE)
add_dependencies(boost boost-bootstrap)
add_library(Boost::boost ALIAS boost)
Expand Down
2 changes: 0 additions & 2 deletions pycode/memilio-generation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# add in C++ library
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../cpp ${CMAKE_CURRENT_BINARY_DIR}/cpp EXCLUDE_FROM_ALL)
add_custom_target(DUMMY ALL)
add_dependencies(DUMMY boost-bootstrap)
FIND_LIBRARY(LIBCLANG_PATH
clang HINTS ${CMAKE_CXX_COMPILER}/../../
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ class TestOseirGeneration(unittest.TestCase):
cmake_cmd, stdout=subprocess.PIPE, cwd=build_dir.name)
cmake_cmd_result.check_returncode()

cmake_cmd = ["cmake", "--build", ".", "--target", "boost-bootstrap"]
cmake_cmd_result = subprocess.run(
cmake_cmd, stdout=subprocess.PIPE, cwd=build_dir.name)
cmake_cmd_result.check_returncode()

@patch('memilio.generation.scanner.utility.try_get_compilation_database_path')
def setUp(self, try_get_compilation_database_path_mock):
try_get_compilation_database_path_mock.return_value = self.build_dir.name
Expand Down