Browse Source

CMake: Add -DYY_NO_UNISTD_H definition to built flex sources

rdb 5 years ago
parent
commit
f8039c0bc8
1 changed files with 4 additions and 0 deletions
  1. 4 0
      cmake/macros/AddFlexTarget.cmake

+ 4 - 0
cmake/macros/AddFlexTarget.cmake

@@ -74,4 +74,8 @@ function(add_flex_target output_cxx input_lxx)
       ${commands}
       DEPENDS ${depends})
   endif()
+
+  if(MSVC)
+    set_source_files_properties(${outputs} PROPERTIES COMPILE_DEFINITIONS YY_NO_UNISTD_H=1)
+  endif()
 endfunction(add_flex_target)