From 83d2f8e76a84130dfcf8b0d07a703d4f2e339667 Mon Sep 17 00:00:00 2001 From: Mike Arpaia Date: Wed, 24 Aug 2016 00:59:03 -0700 Subject: [PATCH] Windows Support --- CMakeLists.txt | 9 +++++++-- README.md | 2 +- lexer.lpp | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 38246aa..b0d1006 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,11 +27,15 @@ IF(FLEX_FOUND) ENDIF() ENDIF() +IF(WIN32) + ADD_DEFINITIONS(-DYY_NO_UNISTD_H) +ENDIF() + FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/c) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -ADD_LIBRARY(graphqlparser SHARED +ADD_LIBRARY(graphqlparser JsonVisitor.cpp ${CMAKE_CURRENT_BINARY_DIR}/Ast.h ${CMAKE_CURRENT_BINARY_DIR}/Ast.cpp @@ -99,7 +103,8 @@ INSTALL(FILES syntaxdefs.h DESTINATION include/graphqlparser) INSTALL(TARGETS graphqlparser - LIBRARY DESTINATION lib) + DESTINATION lib + COMPONENT LIBRARY) if (UNIX) # generate pkgconfig file diff --git a/README.md b/README.md index 4691cb6..924df08 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ pure C API. ## Requirements libgraphqlparser requires a C++ compiler that supports C++11. It -also requires Mac OS X or Linux. +also requires Mac OS X, Linux, or Windows. To run tests, please download googletest from https://googletest.googlecode.com/files/gtest-1.7.0.zip and unzip it diff --git a/lexer.lpp b/lexer.lpp index c7b1d55..85323ca 100644 --- a/lexer.lpp +++ b/lexer.lpp @@ -28,6 +28,8 @@ static void escape(char c, char *buf); %option noyywrap batch noinput nounput %option reentrant %option extra-type="struct LexerExtra *" +%option nounistd +%option never-interactive %x STRING_STATE %x C_COMMENT_STATE