Skip to content
Merged
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
17 changes: 14 additions & 3 deletions recipes/antlr4-cppruntime/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,16 @@ def layout(self):
cmake_layout(self, src_folder="src")

def requirements(self):
# As of 4.11, antlr4-cppruntime no longer requires libuuid.
# Reference: [C++] Remove libuuid dependency (https://github.com/antlr/antlr4/pull/3787)
# 1. As of 4.10, antlr4-cppruntime no longer requires `utfcpp`.
# Reference: [C++] Implement standalone Unicode encoding and decoding handling
# Link: https://github.com/antlr/antlr4/pull/3398
# 2. As of 4.11, antlr4-cppruntime no longer requires `libuuid`.
# Reference: [C++] Remove libuuid dependency
# Link: https://github.com/antlr/antlr4/pull/3787
# Note that the above PR points that libuuid can be removed from 4.9.3, 4.10 and 4.10.1 as well.
# We have patched the CMakeLists.txt to drop the dependency on libuuid from aforementioned antlr versions.
self.requires("utfcpp/3.2.1")
if Version(self.version) < "4.10":
self.requires("utfcpp/3.2.3")

def validate(self):
# Compilation of this library on version 15 claims C2668 Error.
Expand Down Expand Up @@ -92,6 +97,12 @@ def generate(self):
if is_msvc(self):
tc.cache_variables["WITH_STATIC_CRT"] = is_msvc_static_runtime(self)
tc.variables["WITH_DEMO"] = False
# As of ANTLR 4.12.0, one can choose to build the shared/static library only instead of both of them
# Related Issue: https://github.com/antlr/antlr4/issues/3993
# Related PR: https://github.com/antlr/antlr4/pull/3996
if Version(self.version) >= "4.12":
tc.variables["ANTLR_BUILD_SHARED"] = self.options.shared
tc.variables["ANTLR_BUILD_STATIC"] = not self.options.shared
tc.generate()
tc = CMakeDeps(self)
tc.generate()
Expand Down