diff options
author | George Kiagiadakis <george.kiagiadakis@collabora.co.uk> | 2011-01-20 02:46:38 +0200 |
---|---|---|
committer | George Kiagiadakis <george.kiagiadakis@collabora.co.uk> | 2011-01-20 02:55:03 +0200 |
commit | a59072c757a8870bc081127dcc25b457fd5c1e6d (patch) | |
tree | 29135bb9e255e282ca5b6f974883317ef0f62124 /codegen | |
parent | 61acfd04d1b6a6ae826fc7d31586d483bba06aeb (diff) |
Find the path to unistd.h and use it if codegen is being compiled with msvc.
Unfortunately the gnuwin32 version of flex generates an analyzer that
foolishly includes <unistd.h>, so we have to provide it to keep the
compilation working. If you are compiling with msvc, provide this file
somewhere and set -DCMAKE_INCLUDE_PATH=path/to/unistd/include/dir.
Diffstat (limited to 'codegen')
-rw-r--r-- | codegen/CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/codegen/CMakeLists.txt b/codegen/CMakeLists.txt index 99a6c1d..ef26b04 100644 --- a/codegen/CMakeLists.txt +++ b/codegen/CMakeLists.txt @@ -4,5 +4,12 @@ flex_target(analyzer analyzer.l ${CMAKE_CURRENT_BINARY_DIR}/analyzer.cpp) bison_target(parser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp COMPILE_FLAGS "--defines") add_flex_bison_dependency(analyzer parser) +if (MSVC) + find_path(FLEX_UNISTD_H_DIR unistd.h) + if (FLEX_UNISTD_H_DIR) + include_directories(${FLEX_UNISTD_H_DIR}) + endif() +endif() + add_executable(codegen ${FLEX_analyzer_OUTPUTS} ${BISON_parser_OUTPUTS} generator.cpp) target_link_libraries(codegen ${QT_QTCORE_LIBRARY}) |