Skip to content

Commit 89df5b5

Browse files
committed
Merge branch 'HPCC-33593-VCPKG_ANTLR' into future_master
2 parents 71e0ee8 + c37ef32 commit 89df5b5

File tree

9 files changed

+84
-84
lines changed

9 files changed

+84
-84
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[submodule "esp/src/dgrid"]
22
path = esp/src/dgrid
33
url = https://github.com/hpcc-systems/dgrid.git
4-
[submodule "esp/services/ws_sql/libantlr3c"]
5-
path = esp/services/ws_sql/libantlr3c
6-
url = https://github.com/hpcc-systems/libantlr3c.git
74
[submodule "vcpkg"]
85
path = vcpkg
96
url = https://github.com/hpcc-systems/vcpkg.git

cmake_modules/FindANTLR.cmake

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,24 @@
1919
# ANTLR_FOUND - ANTLR found in local system
2020
# ANTLR_BUILDTIME_JAR - The jar needed to build/generate ANTLR Lexers and Parsers
2121
# ANTLR_RUNTIME_JAR - The jar needed to build/generate ANTLR Lexers and Parsers
22+
# ANTLR_LIB - The runtime library needed by the generated ANTLR Lexers and Parsers
2223
################################################################################
2324

2425
include(UseJava)
2526

26-
set(ANTLR_BUILDTIME_DEP "antlr-3.4-complete" CACHE STRING "ANTLR buildtime jar file name.")
27-
set(ANTLR_RUNTIME_DEP "antlr-runtime-3.4" CACHE STRING "ANTLR runtime jar file name.")
28-
set(ANTLR_PATH "${HPCC_SOURCE_DIR}/esp/services/ws_sql/libantlr3c" CACHE PATH "Location of ANTLR jar files.")
29-
set(ANTLR_PKG_FIND_ERROR_MSG "Could not locate jars.\nPlease run `git submodule update --init --recursive`\n")
27+
set(ANTLR_PKG_FIND_ERROR_MSG "Could not locate jars.\nPlease check vcpkg configure completed without issue.\n")
3028

29+
find_library(ANTLR_LIB NAMES antlr3c
30+
PATHS ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}
31+
)
3132

32-
find_jar(ANTLR_BUILDTIME_JAR ${ANTLR_BUILDTIME_DEP} PATHS ${ANTLR_PATH})
33-
find_jar(ANTLR_RUNTIME_JAR ${ANTLR_RUNTIME_DEP} PATHS ${ANTLR_PATH})
33+
find_file(ANTLR_BUILDTIME_JAR "share/antlr3/antlr-3.4-complete.jar"
34+
PATHS ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}
35+
)
36+
37+
find_file(ANTLR_RUNTIME_JAR "share/antlr3/antlr-runtime-3.4.jar"
38+
PATHS ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}
39+
)
3440

3541
include(FindPackageHandleStandardArgs)
3642
find_package_handle_standard_args(

cmake_modules/plugins.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ if (USE_PARQUET)
8585
endif()
8686

8787
# vcpkg.json options ---
88+
set(VCPKG_ANTLR3 "${VCPKG_SUPPRESS}")
89+
if (WSSQL_SERVICE)
90+
set(VCPKG_ANTLR3 "${VCPKG_INCLUDE}")
91+
endif()
92+
8893
set(VCPKG_APR "${VCPKG_SUPPRESS}")
8994
if (USE_APR)
9095
set(VCPKG_APR "${VCPKG_INCLUDE}")

esp/services/ws_sql/CMakeLists.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@ if(WSSQL_SERVICE)
3030
include(${HPCC_SOURCE_DIR}/esp/scm/smcscm.cmake)
3131
include(${HPCC_SOURCE_DIR}/esp/scm/espscm.cmake)
3232

33-
include(antlr3c.cmake)
34-
3533
antlr_target(sql2ecl
3634
GRAMMAR_PREFIX HPCCSQL
3735
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}"
3836
GRAMMAR_FILES "${CMAKE_CURRENT_SOURCE_DIR}/SQL2ECL/ANTLR3c/HPCCSQL.g"
39-
)
37+
)
4038

4139
set(SRCS
4240
${CMAKE_CURRENT_SOURCE_DIR}/ws_sqlPlugin.cpp
@@ -95,7 +93,6 @@ if(WSSQL_SERVICE)
9593
${HPCC_SOURCE_DIR}/common/dllserver
9694
${HPCC_SOURCE_DIR}/common/deftype
9795
${HPCC_SOURCE_DIR}/ecl/hql
98-
${libantlr3c_includes}
9996
${ESPSCM_GENERATED_DIR}
10097
${CMAKE_CURRENT_SOURCE_DIR}/SQL2ECL
10198
${HPCC_SOURCE_DIR}/common/thorhelper
@@ -120,7 +117,7 @@ if(WSSQL_SERVICE)
120117
xmllib
121118
esphttp
122119
dalibase
123-
libantlr3c
120+
${ANTLR_LIB}
124121
wuwebview
125122
${COMMON_ESP_SERVICE_LIBS}
126123
)
@@ -137,5 +134,6 @@ ENDIF()
137134
RUNTIME DESTINATION ${EXEC_DIR}
138135
LIBRARY DESTINATION ${LIB_DIR}
139136
COMPONENT Runtime
140-
)
137+
CALC_DEPS
138+
)
141139
endif()

esp/services/ws_sql/antlr3c.cmake

Lines changed: 0 additions & 68 deletions
This file was deleted.

esp/services/ws_sql/libantlr3c

Lines changed: 0 additions & 1 deletion
This file was deleted.

vcpkg.json.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
"name": "hpcc-platform",
44
"version": "9.10.0",
55
"dependencies": [
6+
{
7+
"name": "antlr3",
8+
"platform": "@VCPKG_ANTLR3@"
9+
},
610
{
711
"name": "apr",
812
"platform": "@VCPKG_APR@"

vcpkg_overlays/antlr3/portfile.cmake

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
vcpkg_download_distfile(LIB_C
2+
URLS "https://github.com/antlr/website-antlr3/raw/refs/heads/gh-pages/download/C/libantlr3c-${VERSION}.tar.gz"
3+
FILENAME "libantlr3c-${VERSION}.tar.gz"
4+
SHA512 8edb243d745ff5bf3b15940f124d1255a9ca965cb656a73a558aed7fa07effcd7620f23dc692e5d5169a03200254836dd57af3ce444ba225281a5b721497e211
5+
)
6+
7+
vcpkg_extract_source_archive(SOURCE_PATH
8+
ARCHIVE "${LIB_C}"
9+
)
10+
11+
set(ARM_FLAG "")
12+
if (LINUX)
13+
execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCHITECTURE)
14+
string(STRIP ${ARCHITECTURE} ARCHITECTURE)
15+
if(ARCHITECTURE MATCHES "arm" OR ARCHITECTURE MATCHES "aarch64")
16+
set(ARM_FLAG "--build=aarch64-unknown-linux")
17+
endif()
18+
endif()
19+
20+
vcpkg_configure_make(
21+
SOURCE_PATH "${SOURCE_PATH}"
22+
COPY_SOURCE
23+
OPTIONS
24+
--enable-64bit
25+
${ARM_FLAG}
26+
)
27+
vcpkg_install_make()
28+
vcpkg_fixup_pkgconfig()
29+
vcpkg_copy_pdbs()
30+
31+
vcpkg_download_distfile(COMPLETE_JAR
32+
URLS "https://github.com/antlr/website-antlr3/raw/refs/heads/gh-pages/download/antlr-${VERSION}-complete.jar"
33+
FILENAME "antlr-${VERSION}-complete.jar"
34+
SHA512 04be4dfba3a21f3ab9d9e439a64958bd8e844a9f151b798383bd9e0dd6ebc416783ae7cb1d1dbb27fb7288ab9756b13b8338cdb8ceb41a10949c852ad45ab1f2
35+
)
36+
37+
vcpkg_download_distfile(RUNTIME_JAR
38+
URLS "https://github.com/antlr/website-antlr3/raw/refs/heads/gh-pages/download/antlr-runtime-${VERSION}.jar"
39+
FILENAME "antlr-runtime-${VERSION}.jar"
40+
SHA512 1786aff2df4664483adcb319e64be7b69b643ac9508c3f11796b5aa45b9072b46f53f0a21b2ff7291162afe81506de16161746273e4532ebad75adbd81203f0d
41+
)
42+
43+
file(INSTALL
44+
DESTINATION "${CURRENT_PACKAGES_DIR}/share/antlr3"
45+
TYPE FILE
46+
FILES ${COMPLETE_JAR} ${RUNTIME_JAR}
47+
)
48+
49+
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")

vcpkg_overlays/antlr3/vcpkg.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "antlr3",
3+
"version": "3.4",
4+
"port-version": 0,
5+
"description": "ANother Tool for Language Recognition",
6+
"homepage": "https://www.antlr.org",
7+
"license": "BSD-3-Clause",
8+
"supports": "!uwp",
9+
"dependencies": []
10+
}

0 commit comments

Comments
 (0)