Skip to content

Windows Support #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really necessary to build as a different flavor of library for Windows? I think this might break the Python/Go examples.

JsonVisitor.cpp
${CMAKE_CURRENT_BINARY_DIR}/Ast.h
${CMAKE_CURRENT_BINARY_DIR}/Ast.cpp
Expand Down Expand Up @@ -99,7 +103,8 @@ INSTALL(FILES
syntaxdefs.h
DESTINATION include/graphqlparser)
INSTALL(TARGETS graphqlparser
LIBRARY DESTINATION lib)
DESTINATION lib
COMPONENT LIBRARY)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


if (UNIX)
# generate pkgconfig file
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lexer.lpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be Windows-gated?

%option never-interactive

%x STRING_STATE
%x C_COMMENT_STATE
Expand Down