diff --git a/oi/CMakeLists.txt b/oi/CMakeLists.txt index 0151b0f..ddf3651 100644 --- a/oi/CMakeLists.txt +++ b/oi/CMakeLists.txt @@ -1,3 +1,8 @@ +add_library(toml + support/Toml.cpp +) +target_link_libraries(toml PUBLIC tomlplusplus::tomlplusplus) + add_library(drgn_utils DrgnUtils.cpp) target_link_libraries(drgn_utils glog::glog @@ -28,7 +33,7 @@ target_link_libraries(container_info drgn_utils # This shouldn't be needed! Clean up Commoh.h! glog::glog - tomlplusplus::tomlplusplus + toml ) add_library(codegen diff --git a/oi/ContainerInfo.cpp b/oi/ContainerInfo.cpp index dfe7657..ff9a6cf 100644 --- a/oi/ContainerInfo.cpp +++ b/oi/ContainerInfo.cpp @@ -16,10 +16,11 @@ #include "oi/ContainerInfo.h" #include -#include #include +#include "oi/support/Toml.h" + namespace fs = std::filesystem; ContainerTypeEnum containerTypeEnumFromStr(std::string& str) { diff --git a/oi/OIUtils.cpp b/oi/OIUtils.cpp index cd78b77..66305ab 100644 --- a/oi/OIUtils.cpp +++ b/oi/OIUtils.cpp @@ -16,7 +16,6 @@ #include "oi/OIUtils.h" #include -#include #include #include @@ -24,6 +23,8 @@ #include #include +#include "oi/support/Toml.h" + namespace fs = std::filesystem; namespace OIUtils { diff --git a/oi/support/Toml.cpp b/oi/support/Toml.cpp new file mode 100644 index 0000000..d1b786b --- /dev/null +++ b/oi/support/Toml.cpp @@ -0,0 +1,17 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#define TOML_IMPLEMENTATION +#include "oi/support/Toml.h" diff --git a/oi/support/Toml.h b/oi/support/Toml.h new file mode 100644 index 0000000..8e08baa --- /dev/null +++ b/oi/support/Toml.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#define TOML_HEADER_ONLY 0 +#include diff --git a/test/integration/CMakeLists.txt b/test/integration/CMakeLists.txt index a40eb0f..99fce56 100644 --- a/test/integration/CMakeLists.txt +++ b/test/integration/CMakeLists.txt @@ -104,7 +104,7 @@ target_link_libraries(integration_test_runner PRIVATE ${GMOCK_MAIN_LIBS} Boost::headers ${Boost_LIBRARIES} - tomlplusplus::tomlplusplus + toml ) target_compile_definitions(integration_test_runner PRIVATE TARGET_EXE_PATH="${CMAKE_CURRENT_BINARY_DIR}/integration_test_target" diff --git a/test/integration/runner_common.cpp b/test/integration/runner_common.cpp index 17e909c..de5505e 100644 --- a/test/integration/runner_common.cpp +++ b/test/integration/runner_common.cpp @@ -1,7 +1,5 @@ #include "runner_common.h" -#include - #include #include #include @@ -15,6 +13,7 @@ #include #include "oi/OIOpts.h" +#include "oi/support/Toml.h" using namespace std::literals;