We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[package] folly/2020.08.10.00: Compile errors on devtoolset-4 gcc5
<!-- 
  Please don't forget to update the issue title.
  Include all applicable information to help us reproduce your problem.
-->

### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **folly/2020.08.10.00**
  * Operating System+version: **Red Hat Enterprise 6**
  * Compiler+version: **GCC 5.3.1 from devtoolset-4**
  * Conan version: **conan 1.29.1**
  * Python version: **Python 3.7.4**


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=5
compiler.libcxx=libstdc++
build_type=Debug
[options]
[build_requires]
[env]
```


### Steps to reproduce (Include if Applicable)

Build recipe using gcc 5.3.1 (devtoolset-4) on RHEL6.  There are two compile errors:

```
/userhome/epederson/.conan/data/folly/2020.08.10.00/test/test/build/21e92cd0e529b036c562d4dfa4ad1adfee8a5c75/source_subfolder/folly/portability/Time.cpp:278:2: error: #error No clock_gettime(3) compatibility wrapper available for this platform.
 #error No clock_gettime(3) compatibility wrapper available for this platform.
  ^
gmake[2]: *** [source_subfolder/CMakeFiles/folly_base.dir/folly/portability/Time.cpp.o] Error 1
```

```
/userhome/epederson/.conan/data/folly/2020.08.10.00/test/test/build/21e92cd0e529b036c562d4dfa4ad1adfee8a5c75/source_subfolder/folly/Benchmark.cpp:340:30: error: expected ‘)’ before ‘PRId64’
               printf("  %-*" PRId64, int(name.length()), ptr->value);
                              ^
```

I will submit a PR with a fix.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `recipes/folly/all/conanfile.py`
Content:
```
1 import os
2 from conans import ConanFile, CMake, tools
3 from conans.tools import Version
4 from conans.errors import ConanInvalidConfiguration
5 
6 required_conan_version = ">=1.28.0"
7 
8 class FollyConan(ConanFile):
9     name = "folly"
10     description = "An open-source C++ components library developed and used at Facebook"
11     topics = ("conan", "folly", "facebook", "components", "core", "efficiency")
12     url = "https://github.com/conan-io/conan-center-index"
13     homepage = "https://github.com/facebook/folly"
14     license = "Apache-2.0"
15     settings = "os", "arch", "compiler", "build_type"
16     options = {"shared": [True, False], "fPIC": [True, False]}
17     default_options = {"shared": False, "fPIC": True}
18     exports_sources = ["CMakeLists.txt", "patches/*"]
19     generators = "cmake", "cmake_find_package"
20 
21     _cmake = None
22 
23     @property
24     def _source_subfolder(self):
25         return "source_subfolder"
26 
27     @property
28     def _minimum_cpp_standard(self):
29         return 14
30 
31     @property
32     def _minimum_compilers_version(self):
33         return {
34             "Visual Studio": "15",
35             "gcc": "5",
36             "clang": "6",
37             "apple-clang": "8",
38         }
39 
40     def config_options(self):
41         if self.settings.os == "Windows":
42             del self.options.fPIC
43 
44     def configure(self):
45         if self.options.shared:
46             del self.options.fPIC
47         if self.settings.get_safe("compiler.cppstd"):
48             tools.check_min_cppstd(self, self._minimum_cpp_standard)
49         min_version = self._minimum_compilers_version.get(
50             str(self.settings.compiler))
51         if not min_version:
52             self.output.warn("{} recipe lacks information about the {} compiler support.".format(
53                 self.name, self.settings.compiler))
54         else:
55             if tools.Version(self.settings.compiler.version) < min_version:
56                 raise ConanInvalidConfiguration("{} requires C++14 support. The current compiler {} {} does not support it.".format(
57                     self.name, self.settings.compiler, self.settings.compiler.version))
58 
59         if self.settings.os == "Windows" and self.settings.arch != "x86_64":
60             raise ConanInvalidConfiguration("Folly requires a 64bit target architecture")
61         elif self.settings.os == "Windows" and self.settings.compiler == "Visual Studio" and \
62                 "MT" in self.settings.compiler.runtime:
63             raise ConanInvalidConfiguration("Folly could not be build with runtime MT")
64         elif self.settings.os == "Macos" and self.options.shared:
65             raise ConanInvalidConfiguration("Folly could not be built by apple-clang as shared library")
66         elif self.settings.os == "Windows" and self.options.shared:
67             raise ConanInvalidConfiguration("Folly could not be built on Windows as a shared library")
68         elif Version(self.version) >= "2020.08.10.00" and self.settings.compiler == "Visual Studio" and \
69                 not self.options.shared:
70             raise ConanInvalidConfiguration("Folly could not be built on Windows as a static library")
71         elif Version(self.version) >= "2020.08.10.00" and self.settings.compiler == "clang" and \
72                 self.options.shared:
73             raise ConanInvalidConfiguration("Folly could not be built by clang as a shared library")
74 
75         self._strip_options_requirements()
76 
77     def _strip_options_requirements(self):
78         self.options["boost"].header_only = False
79         for boost_comp in self._required_boost_components:
80             setattr(self.options["boost"], "without_{}".format(boost_comp), False)
81 
82     @property
83     def _required_boost_components(self):
84         return ["context", "filesystem", "program_options", "regex", "system", "thread"]
85 
86     def requirements(self):
87         self.requires("boost/1.74.0")
88         self.requires("bzip2/1.0.8")
89         self.requires("double-conversion/3.1.5")
90         self.requires("gflags/2.2.2")
91         self.requires("glog/0.4.0")
92         self.requires("libevent/2.1.12")
93         self.requires("lz4/1.9.2")
94         self.requires("openssl/1.1.1h")
95         self.requires("snappy/1.1.8")
96         self.requires("zlib/1.2.11")
97         self.requires("zstd/1.4.5")
98         if Version(self.version) >= "2019.01.01.00":
99             self.requires("libdwarf/20191104")
100             self.requires("libsodium/1.0.18")
101             self.requires("xz_utils/5.2.4")
102             if self.settings.os == "Linux":
103                 self.requires("libiberty/9.1.0")
104                 self.requires("libunwind/1.3.1")
105         if Version(self.version) >= "2020.08.10.00":
106             self.requires("fmt/7.0.3")
107 
108     def _validate_dependency_graph(self):
109         miss_boost_required_comp = any(getattr(self.options["boost"], "without_{}".format(boost_comp), True) for boost_comp in self._required_boost_components)
110         if self.options["boost"].header_only or miss_boost_required_comp:
111             raise ConanInvalidConfiguration("Folly requires these boost components: {}".format(", ".join(self._required_boost_components)))
112 
113     def source(self):
114         tools.get(**self.conan_data["sources"][self.version])
115         extracted_dir = self.name + "-" + self.version
116         os.rename(extracted_dir, self._source_subfolder)
117 
118     def _configure_cmake(self):
119         if not self._cmake:
120             self._cmake = CMake(self)
121             self._cmake.definitions["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True)
122             self._cmake.definitions["CXX_STD"] = self.settings.get_safe(
123                 "compiler.cppstd") or "c++14"
124             if self.settings.compiler == "Visual Studio":
125                 self._cmake.definitions["MSVC_ENABLE_ALL_WARNINGS"] = False
126                 self._cmake.definitions["MSVC_USE_STATIC_RUNTIME"] = "MT" in self.settings.compiler.runtime
127             self._cmake.configure()
128         return self._cmake
129 
130     def build(self):
131         self._validate_dependency_graph()
132         for patch in self.conan_data["patches"][self.version]:
133             tools.patch(**patch)
134         cmake = self._configure_cmake()
135         cmake.build()
136 
137     def package(self):
138         self.copy(pattern="LICENSE", dst="licenses",
139                   src=self._source_subfolder)
140         cmake = self._configure_cmake()
141         cmake.install()
142         tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
143         tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
144 
145     def package_info(self):
146         self.cpp_info.filenames["cmake_find_package"] = "folly"
147         self.cpp_info.filenames["cmake_find_package_multi"] = "folly"
148         self.cpp_info.names["cmake_find_package"] = "Folly"
149         self.cpp_info.names["cmake_find_package_multi"] = "Folly"
150         self.cpp_info.names["pkg_config"] = "libfolly"
151         self.cpp_info.components["libfolly"].names["cmake_find_package"] = "folly"
152         self.cpp_info.components["libfolly"].names["cmake_find_package_multi"] = "folly"
153         self.cpp_info.components["libfolly"].names["pkg_config"] = "libfolly"
154         self.cpp_info.components["libfolly"].libs = tools.collect_libs(self)
155         self.cpp_info.components["libfolly"].requires = [
156             "boost::boost",
157             "bzip2::bzip2",
158             "double-conversion::double-conversion",
159             "gflags::gflags",
160             "glog::glog",
161             "libevent::libevent",
162             "lz4::lz4",
163             "openssl::openssl",
164             "snappy::snappy",
165             "zlib::zlib",
166             "zstd::zstd"
167         ]
168         if Version(self.version) >= "2019.01.01.00":
169             self.cpp_info.components["libfolly"].requires.extend([
170                 "libdwarf::libdwarf",
171                 "libsodium::libsodium",
172                 "xz_utils::xz_utils"
173             ])
174             if self.settings.os == "Linux":
175                 self.cpp_info.components["libfolly"].requires.extend([
176                     "libiberty::libiberty",
177                     "libunwind::libunwind"
178                 ])
179         if Version(self.version) >= "2020.08.10.00":
180             self.cpp_info.components["libfolly"].requires.append("fmt::fmt")
181         if self.settings.os == "Linux":
182             self.cpp_info.components["libfolly"].system_libs.extend(["pthread", "dl"])
183         elif self.settings.os == "Windows":
184             self.cpp_info.components["libfolly"].system_libs.extend(["ws2_32", "Iphlpapi", "Crypt32"])
185         if (self.settings.os == "Linux" and self.settings.compiler == "clang" and
186             self.settings.compiler.libcxx == "libstdc++") or \
187            (self.settings.os == "Macos" and self.settings.compiler == "apple-clang" and
188             Version(self.settings.compiler.version.value) == "9.0" and self.settings.compiler.libcxx == "libc++"):
189             self.cpp_info.components["libfolly"].system_libs.append("atomic")
190
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py
--- a/recipes/folly/all/conanfile.py
+++ b/recipes/folly/all/conanfile.py
@@ -179,7 +179,7 @@
         if Version(self.version) >= "2020.08.10.00":
             self.cpp_info.components["libfolly"].requires.append("fmt::fmt")
         if self.settings.os == "Linux":
-            self.cpp_info.components["libfolly"].system_libs.extend(["pthread", "dl"])
+            self.cpp_info.components["libfolly"].system_libs.extend(["pthread", "dl", "rt"])
         elif self.settings.os == "Windows":
             self.cpp_info.components["libfolly"].system_libs.extend(["ws2_32", "Iphlpapi", "Crypt32"])
         if (self.settings.os == "Linux" and self.settings.compiler == "clang" and

{"golden_diff": "diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py\n--- a/recipes/folly/all/conanfile.py\n+++ b/recipes/folly/all/conanfile.py\n@@ -179,7 +179,7 @@\n         if Version(self.version) >= \"2020.08.10.00\":\n             self.cpp_info.components[\"libfolly\"].requires.append(\"fmt::fmt\")\n         if self.settings.os == \"Linux\":\n-            self.cpp_info.components[\"libfolly\"].system_libs.extend([\"pthread\", \"dl\"])\n+            self.cpp_info.components[\"libfolly\"].system_libs.extend([\"pthread\", \"dl\", \"rt\"])\n         elif self.settings.os == \"Windows\":\n             self.cpp_info.components[\"libfolly\"].system_libs.extend([\"ws2_32\", \"Iphlpapi\", \"Crypt32\"])\n         if (self.settings.os == \"Linux\" and self.settings.compiler == \"clang\" and\n", "issue": "[package] folly/2020.08.10.00: Compile errors on devtoolset-4 gcc5\n<!-- \r\n  Please don't forget to update the issue title.\r\n  Include all applicable information to help us reproduce your problem.\r\n-->\r\n\r\n### Package and Environment Details (include every applicable attribute)\r\n  * Package Name/Version: **folly/2020.08.10.00**\r\n  * Operating System+version: **Red Hat Enterprise 6**\r\n  * Compiler+version: **GCC 5.3.1 from devtoolset-4**\r\n  * Conan version: **conan 1.29.1**\r\n  * Python version: **Python 3.7.4**\r\n\r\n\r\n### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)\r\n```\r\n[settings]\r\nos=Linux\r\nos_build=Linux\r\narch=x86_64\r\narch_build=x86_64\r\ncompiler=gcc\r\ncompiler.version=5\r\ncompiler.libcxx=libstdc++\r\nbuild_type=Debug\r\n[options]\r\n[build_requires]\r\n[env]\r\n```\r\n\r\n\r\n### Steps to reproduce (Include if Applicable)\r\n\r\nBuild recipe using gcc 5.3.1 (devtoolset-4) on RHEL6.  There are two compile errors:\r\n\r\n```\r\n/userhome/epederson/.conan/data/folly/2020.08.10.00/test/test/build/21e92cd0e529b036c562d4dfa4ad1adfee8a5c75/source_subfolder/folly/portability/Time.cpp:278:2: error: #error No clock_gettime(3) compatibility wrapper available for this platform.\r\n #error No clock_gettime(3) compatibility wrapper available for this platform.\r\n  ^\r\ngmake[2]: *** [source_subfolder/CMakeFiles/folly_base.dir/folly/portability/Time.cpp.o] Error 1\r\n```\r\n\r\n```\r\n/userhome/epederson/.conan/data/folly/2020.08.10.00/test/test/build/21e92cd0e529b036c562d4dfa4ad1adfee8a5c75/source_subfolder/folly/Benchmark.cpp:340:30: error: expected \u2018)\u2019 before \u2018PRId64\u2019\r\n               printf(\"  %-*\" PRId64, int(name.length()), ptr->value);\r\n                              ^\r\n```\r\n\r\nI will submit a PR with a fix.\n", "before_files": [{"content": "import os\nfrom conans import ConanFile, CMake, tools\nfrom conans.tools import Version\nfrom conans.errors import ConanInvalidConfiguration\n\nrequired_conan_version = \">=1.28.0\"\n\nclass FollyConan(ConanFile):\n    name = \"folly\"\n    description = \"An open-source C++ components library developed and used at Facebook\"\n    topics = (\"conan\", \"folly\", \"facebook\", \"components\", \"core\", \"efficiency\")\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://github.com/facebook/folly\"\n    license = \"Apache-2.0\"\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\"shared\": [True, False], \"fPIC\": [True, False]}\n    default_options = {\"shared\": False, \"fPIC\": True}\n    exports_sources = [\"CMakeLists.txt\", \"patches/*\"]\n    generators = \"cmake\", \"cmake_find_package\"\n\n    _cmake = None\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\n\n    @property\n    def _minimum_cpp_standard(self):\n        return 14\n\n    @property\n    def _minimum_compilers_version(self):\n        return {\n            \"Visual Studio\": \"15\",\n            \"gcc\": \"5\",\n            \"clang\": \"6\",\n            \"apple-clang\": \"8\",\n        }\n\n    def config_options(self):\n        if self.settings.os == \"Windows\":\n            del self.options.fPIC\n\n    def configure(self):\n        if self.options.shared:\n            del self.options.fPIC\n        if self.settings.get_safe(\"compiler.cppstd\"):\n            tools.check_min_cppstd(self, self._minimum_cpp_standard)\n        min_version = self._minimum_compilers_version.get(\n            str(self.settings.compiler))\n        if not min_version:\n            self.output.warn(\"{} recipe lacks information about the {} compiler support.\".format(\n                self.name, self.settings.compiler))\n        else:\n            if tools.Version(self.settings.compiler.version) < min_version:\n                raise ConanInvalidConfiguration(\"{} requires C++14 support. The current compiler {} {} does not support it.\".format(\n                    self.name, self.settings.compiler, self.settings.compiler.version))\n\n        if self.settings.os == \"Windows\" and self.settings.arch != \"x86_64\":\n            raise ConanInvalidConfiguration(\"Folly requires a 64bit target architecture\")\n        elif self.settings.os == \"Windows\" and self.settings.compiler == \"Visual Studio\" and \\\n                \"MT\" in self.settings.compiler.runtime:\n            raise ConanInvalidConfiguration(\"Folly could not be build with runtime MT\")\n        elif self.settings.os == \"Macos\" and self.options.shared:\n            raise ConanInvalidConfiguration(\"Folly could not be built by apple-clang as shared library\")\n        elif self.settings.os == \"Windows\" and self.options.shared:\n            raise ConanInvalidConfiguration(\"Folly could not be built on Windows as a shared library\")\n        elif Version(self.version) >= \"2020.08.10.00\" and self.settings.compiler == \"Visual Studio\" and \\\n                not self.options.shared:\n            raise ConanInvalidConfiguration(\"Folly could not be built on Windows as a static library\")\n        elif Version(self.version) >= \"2020.08.10.00\" and self.settings.compiler == \"clang\" and \\\n                self.options.shared:\n            raise ConanInvalidConfiguration(\"Folly could not be built by clang as a shared library\")\n\n        self._strip_options_requirements()\n\n    def _strip_options_requirements(self):\n        self.options[\"boost\"].header_only = False\n        for boost_comp in self._required_boost_components:\n            setattr(self.options[\"boost\"], \"without_{}\".format(boost_comp), False)\n\n    @property\n    def _required_boost_components(self):\n        return [\"context\", \"filesystem\", \"program_options\", \"regex\", \"system\", \"thread\"]\n\n    def requirements(self):\n        self.requires(\"boost/1.74.0\")\n        self.requires(\"bzip2/1.0.8\")\n        self.requires(\"double-conversion/3.1.5\")\n        self.requires(\"gflags/2.2.2\")\n        self.requires(\"glog/0.4.0\")\n        self.requires(\"libevent/2.1.12\")\n        self.requires(\"lz4/1.9.2\")\n        self.requires(\"openssl/1.1.1h\")\n        self.requires(\"snappy/1.1.8\")\n        self.requires(\"zlib/1.2.11\")\n        self.requires(\"zstd/1.4.5\")\n        if Version(self.version) >= \"2019.01.01.00\":\n            self.requires(\"libdwarf/20191104\")\n            self.requires(\"libsodium/1.0.18\")\n            self.requires(\"xz_utils/5.2.4\")\n            if self.settings.os == \"Linux\":\n                self.requires(\"libiberty/9.1.0\")\n                self.requires(\"libunwind/1.3.1\")\n        if Version(self.version) >= \"2020.08.10.00\":\n            self.requires(\"fmt/7.0.3\")\n\n    def _validate_dependency_graph(self):\n        miss_boost_required_comp = any(getattr(self.options[\"boost\"], \"without_{}\".format(boost_comp), True) for boost_comp in self._required_boost_components)\n        if self.options[\"boost\"].header_only or miss_boost_required_comp:\n            raise ConanInvalidConfiguration(\"Folly requires these boost components: {}\".format(\", \".join(self._required_boost_components)))\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        extracted_dir = self.name + \"-\" + self.version\n        os.rename(extracted_dir, self._source_subfolder)\n\n    def _configure_cmake(self):\n        if not self._cmake:\n            self._cmake = CMake(self)\n            self._cmake.definitions[\"CMAKE_POSITION_INDEPENDENT_CODE\"] = self.options.get_safe(\"fPIC\", True)\n            self._cmake.definitions[\"CXX_STD\"] = self.settings.get_safe(\n                \"compiler.cppstd\") or \"c++14\"\n            if self.settings.compiler == \"Visual Studio\":\n                self._cmake.definitions[\"MSVC_ENABLE_ALL_WARNINGS\"] = False\n                self._cmake.definitions[\"MSVC_USE_STATIC_RUNTIME\"] = \"MT\" in self.settings.compiler.runtime\n            self._cmake.configure()\n        return self._cmake\n\n    def build(self):\n        self._validate_dependency_graph()\n        for patch in self.conan_data[\"patches\"][self.version]:\n            tools.patch(**patch)\n        cmake = self._configure_cmake()\n        cmake.build()\n\n    def package(self):\n        self.copy(pattern=\"LICENSE\", dst=\"licenses\",\n                  src=self._source_subfolder)\n        cmake = self._configure_cmake()\n        cmake.install()\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"pkgconfig\"))\n\n    def package_info(self):\n        self.cpp_info.filenames[\"cmake_find_package\"] = \"folly\"\n        self.cpp_info.filenames[\"cmake_find_package_multi\"] = \"folly\"\n        self.cpp_info.names[\"cmake_find_package\"] = \"Folly\"\n        self.cpp_info.names[\"cmake_find_package_multi\"] = \"Folly\"\n        self.cpp_info.names[\"pkg_config\"] = \"libfolly\"\n        self.cpp_info.components[\"libfolly\"].names[\"cmake_find_package\"] = \"folly\"\n        self.cpp_info.components[\"libfolly\"].names[\"cmake_find_package_multi\"] = \"folly\"\n        self.cpp_info.components[\"libfolly\"].names[\"pkg_config\"] = \"libfolly\"\n        self.cpp_info.components[\"libfolly\"].libs = tools.collect_libs(self)\n        self.cpp_info.components[\"libfolly\"].requires = [\n            \"boost::boost\",\n            \"bzip2::bzip2\",\n            \"double-conversion::double-conversion\",\n            \"gflags::gflags\",\n            \"glog::glog\",\n            \"libevent::libevent\",\n            \"lz4::lz4\",\n            \"openssl::openssl\",\n            \"snappy::snappy\",\n            \"zlib::zlib\",\n            \"zstd::zstd\"\n        ]\n        if Version(self.version) >= \"2019.01.01.00\":\n            self.cpp_info.components[\"libfolly\"].requires.extend([\n                \"libdwarf::libdwarf\",\n                \"libsodium::libsodium\",\n                \"xz_utils::xz_utils\"\n            ])\n            if self.settings.os == \"Linux\":\n                self.cpp_info.components[\"libfolly\"].requires.extend([\n                    \"libiberty::libiberty\",\n                    \"libunwind::libunwind\"\n                ])\n        if Version(self.version) >= \"2020.08.10.00\":\n            self.cpp_info.components[\"libfolly\"].requires.append(\"fmt::fmt\")\n        if self.settings.os == \"Linux\":\n            self.cpp_info.components[\"libfolly\"].system_libs.extend([\"pthread\", \"dl\"])\n        elif self.settings.os == \"Windows\":\n            self.cpp_info.components[\"libfolly\"].system_libs.extend([\"ws2_32\", \"Iphlpapi\", \"Crypt32\"])\n        if (self.settings.os == \"Linux\" and self.settings.compiler == \"clang\" and\n            self.settings.compiler.libcxx == \"libstdc++\") or \\\n           (self.settings.os == \"Macos\" and self.settings.compiler == \"apple-clang\" and\n            Version(self.settings.compiler.version.value) == \"9.0\" and self.settings.compiler.libcxx == \"libc++\"):\n            self.cpp_info.components[\"libfolly\"].system_libs.append(\"atomic\")\n", "path": "recipes/folly/all/conanfile.py"}], "after_files": [{"content": "import os\nfrom conans import ConanFile, CMake, tools\nfrom conans.tools import Version\nfrom conans.errors import ConanInvalidConfiguration\n\nrequired_conan_version = \">=1.28.0\"\n\nclass FollyConan(ConanFile):\n    name = \"folly\"\n    description = \"An open-source C++ components library developed and used at Facebook\"\n    topics = (\"conan\", \"folly\", \"facebook\", \"components\", \"core\", \"efficiency\")\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://github.com/facebook/folly\"\n    license = \"Apache-2.0\"\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\"shared\": [True, False], \"fPIC\": [True, False]}\n    default_options = {\"shared\": False, \"fPIC\": True}\n    exports_sources = [\"CMakeLists.txt\", \"patches/*\"]\n    generators = \"cmake\", \"cmake_find_package\"\n\n    _cmake = None\n\n    @property\n    def _source_subfolder(self):\n        return \"source_subfolder\"\n\n    @property\n    def _minimum_cpp_standard(self):\n        return 14\n\n    @property\n    def _minimum_compilers_version(self):\n        return {\n            \"Visual Studio\": \"15\",\n            \"gcc\": \"5\",\n            \"clang\": \"6\",\n            \"apple-clang\": \"8\",\n        }\n\n    def config_options(self):\n        if self.settings.os == \"Windows\":\n            del self.options.fPIC\n\n    def configure(self):\n        if self.options.shared:\n            del self.options.fPIC\n        if self.settings.get_safe(\"compiler.cppstd\"):\n            tools.check_min_cppstd(self, self._minimum_cpp_standard)\n        min_version = self._minimum_compilers_version.get(\n            str(self.settings.compiler))\n        if not min_version:\n            self.output.warn(\"{} recipe lacks information about the {} compiler support.\".format(\n                self.name, self.settings.compiler))\n        else:\n            if tools.Version(self.settings.compiler.version) < min_version:\n                raise ConanInvalidConfiguration(\"{} requires C++14 support. The current compiler {} {} does not support it.\".format(\n                    self.name, self.settings.compiler, self.settings.compiler.version))\n\n        if self.settings.os == \"Windows\" and self.settings.arch != \"x86_64\":\n            raise ConanInvalidConfiguration(\"Folly requires a 64bit target architecture\")\n        elif self.settings.os == \"Windows\" and self.settings.compiler == \"Visual Studio\" and \\\n                \"MT\" in self.settings.compiler.runtime:\n            raise ConanInvalidConfiguration(\"Folly could not be build with runtime MT\")\n        elif self.settings.os == \"Macos\" and self.options.shared:\n            raise ConanInvalidConfiguration(\"Folly could not be built by apple-clang as shared library\")\n        elif self.settings.os == \"Windows\" and self.options.shared:\n            raise ConanInvalidConfiguration(\"Folly could not be built on Windows as a shared library\")\n        elif Version(self.version) >= \"2020.08.10.00\" and self.settings.compiler == \"Visual Studio\" and \\\n                not self.options.shared:\n            raise ConanInvalidConfiguration(\"Folly could not be built on Windows as a static library\")\n        elif Version(self.version) >= \"2020.08.10.00\" and self.settings.compiler == \"clang\" and \\\n                self.options.shared:\n            raise ConanInvalidConfiguration(\"Folly could not be built by clang as a shared library\")\n\n        self._strip_options_requirements()\n\n    def _strip_options_requirements(self):\n        self.options[\"boost\"].header_only = False\n        for boost_comp in self._required_boost_components:\n            setattr(self.options[\"boost\"], \"without_{}\".format(boost_comp), False)\n\n    @property\n    def _required_boost_components(self):\n        return [\"context\", \"filesystem\", \"program_options\", \"regex\", \"system\", \"thread\"]\n\n    def requirements(self):\n        self.requires(\"boost/1.74.0\")\n        self.requires(\"bzip2/1.0.8\")\n        self.requires(\"double-conversion/3.1.5\")\n        self.requires(\"gflags/2.2.2\")\n        self.requires(\"glog/0.4.0\")\n        self.requires(\"libevent/2.1.12\")\n        self.requires(\"lz4/1.9.2\")\n        self.requires(\"openssl/1.1.1h\")\n        self.requires(\"snappy/1.1.8\")\n        self.requires(\"zlib/1.2.11\")\n        self.requires(\"zstd/1.4.5\")\n        if Version(self.version) >= \"2019.01.01.00\":\n            self.requires(\"libdwarf/20191104\")\n            self.requires(\"libsodium/1.0.18\")\n            self.requires(\"xz_utils/5.2.4\")\n            if self.settings.os == \"Linux\":\n                self.requires(\"libiberty/9.1.0\")\n                self.requires(\"libunwind/1.3.1\")\n        if Version(self.version) >= \"2020.08.10.00\":\n            self.requires(\"fmt/7.0.3\")\n\n    def _validate_dependency_graph(self):\n        miss_boost_required_comp = any(getattr(self.options[\"boost\"], \"without_{}\".format(boost_comp), True) for boost_comp in self._required_boost_components)\n        if self.options[\"boost\"].header_only or miss_boost_required_comp:\n            raise ConanInvalidConfiguration(\"Folly requires these boost components: {}\".format(\", \".join(self._required_boost_components)))\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        extracted_dir = self.name + \"-\" + self.version\n        os.rename(extracted_dir, self._source_subfolder)\n\n    def _configure_cmake(self):\n        if not self._cmake:\n            self._cmake = CMake(self)\n            self._cmake.definitions[\"CMAKE_POSITION_INDEPENDENT_CODE\"] = self.options.get_safe(\"fPIC\", True)\n            self._cmake.definitions[\"CXX_STD\"] = self.settings.get_safe(\n                \"compiler.cppstd\") or \"c++14\"\n            if self.settings.compiler == \"Visual Studio\":\n                self._cmake.definitions[\"MSVC_ENABLE_ALL_WARNINGS\"] = False\n                self._cmake.definitions[\"MSVC_USE_STATIC_RUNTIME\"] = \"MT\" in self.settings.compiler.runtime\n            self._cmake.configure()\n        return self._cmake\n\n    def build(self):\n        self._validate_dependency_graph()\n        for patch in self.conan_data[\"patches\"][self.version]:\n            tools.patch(**patch)\n        cmake = self._configure_cmake()\n        cmake.build()\n\n    def package(self):\n        self.copy(pattern=\"LICENSE\", dst=\"licenses\",\n                  src=self._source_subfolder)\n        cmake = self._configure_cmake()\n        cmake.install()\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"pkgconfig\"))\n\n    def package_info(self):\n        self.cpp_info.filenames[\"cmake_find_package\"] = \"folly\"\n        self.cpp_info.filenames[\"cmake_find_package_multi\"] = \"folly\"\n        self.cpp_info.names[\"cmake_find_package\"] = \"Folly\"\n        self.cpp_info.names[\"cmake_find_package_multi\"] = \"Folly\"\n        self.cpp_info.names[\"pkg_config\"] = \"libfolly\"\n        self.cpp_info.components[\"libfolly\"].names[\"cmake_find_package\"] = \"folly\"\n        self.cpp_info.components[\"libfolly\"].names[\"cmake_find_package_multi\"] = \"folly\"\n        self.cpp_info.components[\"libfolly\"].names[\"pkg_config\"] = \"libfolly\"\n        self.cpp_info.components[\"libfolly\"].libs = tools.collect_libs(self)\n        self.cpp_info.components[\"libfolly\"].requires = [\n            \"boost::boost\",\n            \"bzip2::bzip2\",\n            \"double-conversion::double-conversion\",\n            \"gflags::gflags\",\n            \"glog::glog\",\n            \"libevent::libevent\",\n            \"lz4::lz4\",\n            \"openssl::openssl\",\n            \"snappy::snappy\",\n            \"zlib::zlib\",\n            \"zstd::zstd\"\n        ]\n        if Version(self.version) >= \"2019.01.01.00\":\n            self.cpp_info.components[\"libfolly\"].requires.extend([\n                \"libdwarf::libdwarf\",\n                \"libsodium::libsodium\",\n                \"xz_utils::xz_utils\"\n            ])\n            if self.settings.os == \"Linux\":\n                self.cpp_info.components[\"libfolly\"].requires.extend([\n                    \"libiberty::libiberty\",\n                    \"libunwind::libunwind\"\n                ])\n        if Version(self.version) >= \"2020.08.10.00\":\n            self.cpp_info.components[\"libfolly\"].requires.append(\"fmt::fmt\")\n        if self.settings.os == \"Linux\":\n            self.cpp_info.components[\"libfolly\"].system_libs.extend([\"pthread\", \"dl\", \"rt\"])\n        elif self.settings.os == \"Windows\":\n            self.cpp_info.components[\"libfolly\"].system_libs.extend([\"ws2_32\", \"Iphlpapi\", \"Crypt32\"])\n        if (self.settings.os == \"Linux\" and self.settings.compiler == \"clang\" and\n            self.settings.compiler.libcxx == \"libstdc++\") or \\\n           (self.settings.os == \"Macos\" and self.settings.compiler == \"apple-clang\" and\n            Version(self.settings.compiler.version.value) == \"9.0\" and self.settings.compiler.libcxx == \"libc++\"):\n            self.cpp_info.components[\"libfolly\"].system_libs.append(\"atomic\")\n", "path": "recipes/folly/all/conanfile.py"}]}