early-access version 2853
This commit is contained in:
22
externals/vcpkg/ports/antlr4/export_guid.patch
vendored
Executable file
22
externals/vcpkg/ports/antlr4/export_guid.patch
vendored
Executable file
@@ -0,0 +1,22 @@
|
||||
diff -urN a/runtime/src/support/Guid.h b/runtime/src/support/Guid.h
|
||||
--- a/runtime/src/support/Guid.h
|
||||
+++ b/runtime/src/support/Guid.h
|
||||
@@ -42,7 +42,7 @@ namespace antlrcpp {
|
||||
// 16 byte value that can be passed around by value. It also supports
|
||||
// conversion to string (via the stream operator <<) and conversion from a
|
||||
// string via constructor.
|
||||
-class Guid final {
|
||||
+class ANTLR4CPP_PUBLIC Guid final {
|
||||
public:
|
||||
using size_type = typename std::array<uint8_t, 16>::size_type;
|
||||
using pointer = typename std::array<uint8_t, 16>::pointer;
|
||||
@@ -131,7 +131,7 @@ private:
|
||||
// function would no longer be cross-platform if we parameterized the android
|
||||
// version. Instead, construction of the GuidGenerator may be different on
|
||||
// each platform, but the use of newGuid is uniform.
|
||||
-class GuidGenerator final {
|
||||
+class ANTLR4CPP_PUBLIC GuidGenerator final {
|
||||
public:
|
||||
#ifdef GUID_ANDROID
|
||||
GuidGenerator(JNIEnv *env);
|
||||
|
||||
115
externals/vcpkg/ports/antlr4/fixed_build.patch
vendored
Executable file
115
externals/vcpkg/ports/antlr4/fixed_build.patch
vendored
Executable file
@@ -0,0 +1,115 @@
|
||||
diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt
|
||||
index c8b16c6..53b47dd 100644
|
||||
--- a/runtime/CMakeLists.txt
|
||||
+++ b/runtime/CMakeLists.txt
|
||||
@@ -21,10 +21,13 @@ file(GLOB libantlrcpp_SRC
|
||||
"${PROJECT_SOURCE_DIR}/runtime/src/tree/xpath/*.cpp"
|
||||
)
|
||||
|
||||
+if(BUILD_SHARED_LIBS)
|
||||
add_library(antlr4_shared SHARED ${libantlrcpp_SRC})
|
||||
+else()
|
||||
add_library(antlr4_static STATIC ${libantlrcpp_SRC})
|
||||
+endif()
|
||||
|
||||
-set(LIB_OUTPUT_DIR "${CMAKE_HOME_DIRECTORY}/dist") # put generated libraries here.
|
||||
+#set(LIB_OUTPUT_DIR "${CMAKE_HOME_DIRECTORY}/dist") # put generated libraries here.
|
||||
message(STATUS "Output libraries to ${LIB_OUTPUT_DIR}")
|
||||
|
||||
# make sure 'make' works fine even if ${LIB_OUTPUT_DIR} is deleted.
|
||||
@@ -32,16 +35,22 @@ add_custom_target(make_lib_output_dir ALL
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${LIB_OUTPUT_DIR}
|
||||
)
|
||||
|
||||
+if(BUILD_SHARED_LIBS)
|
||||
add_dependencies(antlr4_shared make_lib_output_dir)
|
||||
+else()
|
||||
add_dependencies(antlr4_static make_lib_output_dir)
|
||||
+endif()
|
||||
|
||||
find_package(utf8cpp QUIET)
|
||||
|
||||
set(INSTALL_utf8cpp FALSE)
|
||||
|
||||
if (utf8cpp_FOUND)
|
||||
+ if(BUILD_SHARED_LIBS)
|
||||
target_link_libraries(antlr4_shared utf8cpp)
|
||||
+ else()
|
||||
target_link_libraries(antlr4_static utf8cpp)
|
||||
+ endif()
|
||||
else()
|
||||
|
||||
# older utf8cpp doesn't define the package above
|
||||
@@ -51,7 +60,7 @@ else()
|
||||
|
||||
if (utf8cpp_HEADER)
|
||||
include_directories(${utf8cpp_HEADER})
|
||||
- else()
|
||||
+ elseif(0)
|
||||
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
|
||||
set(THIRDPARTY_DIR ${CMAKE_BINARY_DIR}/runtime/thirdparty)
|
||||
set(UTFCPP_DIR ${THIRDPARTY_DIR}/utfcpp)
|
||||
@@ -76,11 +85,17 @@ else()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
+ if(BUILD_SHARED_LIBS)
|
||||
target_link_libraries(antlr4_shared ${UUID_LIBRARIES})
|
||||
+ else()
|
||||
target_link_libraries(antlr4_static ${UUID_LIBRARIES})
|
||||
+ endif()
|
||||
elseif(APPLE)
|
||||
+ if(BUILD_SHARED_LIBS)
|
||||
target_link_libraries(antlr4_shared ${COREFOUNDATION_LIBRARY})
|
||||
+ else()
|
||||
target_link_libraries(antlr4_static ${COREFOUNDATION_LIBRARY})
|
||||
+ endif()
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
@@ -102,7 +117,7 @@ if(WIN32)
|
||||
set(extra_share_compile_flags "-DANTLR4CPP_EXPORTS")
|
||||
set(extra_static_compile_flags "-DANTLR4CPP_STATIC")
|
||||
endif(WIN32)
|
||||
-if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
+if(0)
|
||||
if(WITH_STATIC_CRT)
|
||||
target_compile_options(antlr4_shared PRIVATE "/MT$<$<CONFIG:Debug>:d>")
|
||||
target_compile_options(antlr4_static PRIVATE "/MT$<$<CONFIG:Debug>:d>")
|
||||
@@ -122,6 +137,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
set(extra_static_compile_flags "-DANTLR4CPP_STATIC -MP")
|
||||
endif()
|
||||
|
||||
+if(BUILD_SHARED_LIBS)
|
||||
set_target_properties(antlr4_shared
|
||||
PROPERTIES VERSION ${ANTLR_VERSION}
|
||||
SOVERSION ${ANTLR_VERSION}
|
||||
@@ -132,20 +148,25 @@ set_target_properties(antlr4_shared
|
||||
RUNTIME_OUTPUT_DIRECTORY ${LIB_OUTPUT_DIR}
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${LIB_OUTPUT_DIR}
|
||||
COMPILE_FLAGS "${disabled_compile_warnings} ${extra_share_compile_flags}")
|
||||
-
|
||||
+else()
|
||||
set_target_properties(antlr4_static
|
||||
PROPERTIES VERSION ${ANTLR_VERSION}
|
||||
SOVERSION ${ANTLR_VERSION}
|
||||
OUTPUT_NAME "antlr4-runtime${static_lib_suffix}"
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${LIB_OUTPUT_DIR}
|
||||
COMPILE_FLAGS "${disabled_compile_warnings} ${extra_static_compile_flags}")
|
||||
+endif()
|
||||
|
||||
-install(TARGETS antlr4_shared
|
||||
+if(BUILD_SHARED_LIBS)
|
||||
+install(TARGETS antlr4_shared EXPORT antlr4-targets
|
||||
DESTINATION lib
|
||||
- EXPORT antlr4-targets)
|
||||
+ RUNTIME DESTINATION bin
|
||||
+ )
|
||||
+else()
|
||||
install(TARGETS antlr4_static
|
||||
DESTINATION lib
|
||||
EXPORT antlr4-targets)
|
||||
+endif()
|
||||
|
||||
install(DIRECTORY "${PROJECT_SOURCE_DIR}/runtime/src/"
|
||||
DESTINATION "include/antlr4-runtime"
|
||||
43
externals/vcpkg/ports/antlr4/portfile.cmake
vendored
Executable file
43
externals/vcpkg/ports/antlr4/portfile.cmake
vendored
Executable file
@@ -0,0 +1,43 @@
|
||||
set(VERSION 4.9.3)
|
||||
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "https://www.antlr.org/download/antlr4-cpp-runtime-${VERSION}-source.zip"
|
||||
FILENAME "antlr4-cpp-runtime-${VERSION}-source.zip"
|
||||
SHA512 23995a6fa661ff038142fa7220a195db3a9a26744d516011dedc3192f152b06a8e31f6cc8f969f8927b86392a960d03e89572e753f033f950839a5bd38d4c722
|
||||
)
|
||||
|
||||
# license not exist in antlr folder.
|
||||
vcpkg_download_distfile(LICENSE
|
||||
URLS https://raw.githubusercontent.com/antlr/antlr4/${VERSION}/LICENSE.txt
|
||||
FILENAME "antlr4-copyright-${VERSION}"
|
||||
SHA512 1e8414de5fdc211e3188a8ec3276c6b3c55235f5edaf48522045ae18fa79fd9049719cb8924d25145016f223ac9a178defada1eeb983ccff598a08b0c0f67a3b
|
||||
)
|
||||
|
||||
vcpkg_extract_source_archive_ex(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
ARCHIVE ${ARCHIVE}
|
||||
NO_REMOVE_ONE_LEVEL
|
||||
REF ${VERSION}
|
||||
PATCHES
|
||||
fixed_build.patch
|
||||
uuid_discovery_fix.patch
|
||||
export_guid.patch
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DANTLR4_INSTALL=ON
|
||||
OPTIONS_DEBUG -DLIB_OUTPUT_DIR=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/dist
|
||||
OPTIONS_RELEASE -DLIB_OUTPUT_DIR=${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/dist
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME antlr4-generator CONFIG_PATH lib/cmake/antlr4-generator DO_NOT_DELETE_PARENT_CONFIG_PATH)
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME antlr4-runtime CONFIG_PATH lib/cmake/antlr4-runtime)
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(INSTALL "${LICENSE}" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
35
externals/vcpkg/ports/antlr4/uuid_discovery_fix.patch
vendored
Executable file
35
externals/vcpkg/ports/antlr4/uuid_discovery_fix.patch
vendored
Executable file
@@ -0,0 +1,35 @@
|
||||
diff -urN a/CMakeLists.txt b/CMakeLists.txt
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -42,8 +42,10 @@ if(CMAKE_VERSION VERSION_EQUAL "3.3.0" OR
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
- find_package(PkgConfig REQUIRED)
|
||||
- pkg_check_modules(UUID REQUIRED uuid)
|
||||
+ find_path(UUID_INCLUDE_DIR uuid/uuid.h)
|
||||
+ find_library(UUID_LIBRARY NAMES uuid)
|
||||
+ include_directories(${UUID_INCLUDE_DIR})
|
||||
+ link_libraries(${UUID_LIBRARY})
|
||||
endif()
|
||||
if(APPLE)
|
||||
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
|
||||
diff --git a/runtime/src/support/Guid.cpp b/runtime/src/support/Guid.cpp
|
||||
--- a/runtime/src/support/Guid.cpp
|
||||
+++ b/runtime/src/support/Guid.cpp
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
+#include "antlr4-common.h"
|
||||
#include "Guid.h"
|
||||
|
||||
#ifdef GUID_LIBUUID
|
||||
@@ -35,6 +36,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef GUID_WINDOWS
|
||||
+#define NOMINMAX
|
||||
#include <objbase.h>
|
||||
#endif
|
||||
|
||||
23
externals/vcpkg/ports/antlr4/vcpkg.json
vendored
Executable file
23
externals/vcpkg/ports/antlr4/vcpkg.json
vendored
Executable file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "antlr4",
|
||||
"version": "4.9.3",
|
||||
"port-version": 2,
|
||||
"description": "ANother Tool for Language Recognition",
|
||||
"homepage": "https://www.antlr.org",
|
||||
"license": "BSD-3-Clause",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "libuuid",
|
||||
"platform": "!uwp & !windows & !osx"
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user