[graphqlparser] Use default library type for the platform instead of specifying SHARED (#4794)

* Use default library type for the platform instead of specifying SHARED

* [graphqlparser] Bump control version and slight cleanup

* [vcpkg_find_acquire_program] Correct for previous corruption of CI
This commit is contained in:
Bill Avery 2018-12-17 16:26:56 -08:00 committed by Robert Schumacher
parent ac1bed33ad
commit ae2b0639a3
4 changed files with 40 additions and 51 deletions

View File

@ -1,3 +1,3 @@
Source: graphqlparser
Version: v0.7.0
Version: 0.7.0
Description: A GraphQL query parser in C++ with C and C++ APIs

View File

@ -1,15 +1,3 @@
# Common Ambient Variables:
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
# CURRENT_PORT_DIR = ${VCPKG_ROOT_DIR}\ports\${PORT}
# PORT = current port name (zlib, etc)
# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc)
# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic)
# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic)
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm)
#
include(vcpkg_common_functions)
vcpkg_from_github(
@ -18,7 +6,7 @@ vcpkg_from_github(
REF v0.7.0
SHA512 973292b164d0d2cfe453a2f01559dbdb1b9d22b6304f6a3aabf71e2c0a3e24ab69dfd72a086764ad5befecf0005620f8e86f552dacc324f9615a05f31de7cede
HEAD_REF master
PATCHES ${CMAKE_CURRENT_LIST_DIR}/win-cmake.patch
PATCHES win-cmake.patch
)
if(UNIX)
@ -28,7 +16,7 @@ if(UNIX)
)
elseif(WIN32)
vcpkg_find_acquire_program(PYTHON2)
vcpkg_find_acquire_program(FLEX)
vcpkg_find_acquire_program(FLEX) #
vcpkg_find_acquire_program(BISON)
get_filename_component(VCPKG_DOWNLOADS_PYTHON2_DIR "${PYTHON2}" DIRECTORY)
@ -47,5 +35,7 @@ endif()
vcpkg_install_cmake()
vcpkg_copy_pdbs()
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/graphqlparser RENAME copyright)
configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/graphqlparser/copyright COPYONLY)

View File

@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c4c8b3e..f19cda3 100644
index c4c8b3e..3373d82 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,16 +3,37 @@ PROJECT(libgraphqlparser C CXX)
@@ -3,9 +3,26 @@ PROJECT(libgraphqlparser C CXX)
SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")
@ -31,19 +31,7 @@ index c4c8b3e..f19cda3 100644
FIND_PACKAGE(PythonInterp 2 REQUIRED)
IF (NOT PYTHON_VERSION_MAJOR EQUAL 2)
MESSAGE(FATAL_ERROR "Python 2 is required.")
ENDIF()
-FIND_PROGRAM(CTYPESGEN_FOUND ctypesgen.py)
+IF(UNIX)
+ SET(FLEX_COMPILE_FLAGS "--header-file=lexer.h")
+ELSEIF(WIN32)
+ SET(FLEX_COMPILE_FLAGS "--header-file=lexer.h --wincompat")
+ENDIF()
FIND_PACKAGE(BISON 3)
FIND_PACKAGE(FLEX)
@@ -21,7 +42,7 @@ IF (BISON_FOUND)
@@ -21,7 +38,7 @@ IF (BISON_FOUND)
ENDIF()
IF(FLEX_FOUND)
@ -52,20 +40,27 @@ index c4c8b3e..f19cda3 100644
IF (BISON_FOUND)
ADD_FLEX_BISON_DEPENDENCY(GraphQLScanner graphqlparser)
ENDIF()
@@ -83,11 +104,8 @@ GENERATE_AST_FILE(cxx_json_visitor_header JsonVisitor.h.inc)
@@ -31,7 +48,7 @@ FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/c)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
GENERATE_AST_FILE(cxx_json_visitor_impl JsonVisitor.cpp.inc)
-ADD_LIBRARY(graphqlparser SHARED
+ADD_LIBRARY(graphqlparser
JsonVisitor.cpp
${CMAKE_CURRENT_BINARY_DIR}/Ast.h
${CMAKE_CURRENT_BINARY_DIR}/Ast.cpp
@@ -87,7 +104,9 @@ ADD_SUBDIRECTORY(python)
-ADD_SUBDIRECTORY(python)
-
-OPTION(test "Build tests." OFF)
-
INSTALL(DIRECTORY c ${CMAKE_CURRENT_BINARY_DIR}/c DESTINATION include/graphqlparser
OPTION(test "Build tests." OFF)
-INSTALL(DIRECTORY c ${CMAKE_CURRENT_BINARY_DIR}/c DESTINATION include/graphqlparser
+INSTALL(DIRECTORY c ${CMAKE_CURRENT_BINARY_DIR}/c
+ DESTINATION include/graphqlparser
+ CONFIGURATIONS Release
FILES_MATCHING PATTERN "*.h"
PATTERN "build" EXCLUDE)
@@ -103,9 +121,12 @@ INSTALL(FILES
@@ -103,9 +122,13 @@ INSTALL(FILES
position.hh
stack.hh
syntaxdefs.h
@ -75,12 +70,13 @@ index c4c8b3e..f19cda3 100644
+
INSTALL(TARGETS graphqlparser
- LIBRARY DESTINATION lib)
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+ RUNTIME DESTINATION bin)
if (UNIX)
# generate pkgconfig file
@@ -116,16 +137,9 @@ if (UNIX)
@@ -116,6 +139,11 @@ if (UNIX)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libgraphqlparser.pc"
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
endif()
@ -90,15 +86,15 @@ index c4c8b3e..f19cda3 100644
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/graphqlparser.pdb
+ DESTINATION bin)
endif()
IF (test)
@@ -126,6 +154,8 @@ IF (test)
ADD_CUSTOM_TARGET(memcheck
valgrind --leak-check=full --suppressions=./test/valgrind.supp --dsymutil=yes --error-exitcode=1 ./test/runTests >/dev/null
)
+ else()
+ ADD_CUSTOM_TARGET(runTests
+ ./test/runTests >/dev/null)
endif()
-
-IF (test)
- ADD_SUBDIRECTORY(test)
-
- if(UNIX)
- # setup valgrind
- ADD_CUSTOM_TARGET(memcheck
- valgrind --leak-check=full --suppressions=./test/valgrind.supp --dsymutil=yes --error-exitcode=1 ./test/runTests >/dev/null
- )
- endif()
-
-ENDIF()
ENDIF()

View File

@ -153,6 +153,9 @@ function(vcpkg_find_acquire_program VAR)
set(URL "https://sourceforge.net/projects/winflexbison/files/winflexbison-2.5.16.zip/download")
set(ARCHIVE "win_flex_bison-2.5.16.zip")
set(HASH 0a14154bff5d998feb23903c46961528f8ccb4464375d5384db8c4a7d230c0c599da9b68e7a32f3217a0a0735742242eaf3769cb4f03e00931af8640250e9123)
if(NOT EXISTS "${PATHS}/data/m4sugar/m4sugar.m4" AND SUBDIR STREQUAL "win_flex-2.5.16")
file(REMOVE_RECURSE "${PATHS}")
endif()
else()
set(PROGNAME flex)
set(APT_PACKAGE_NAME flex)