Ver código fonte

CMake: Add -DYY_NO_UNISTD_H definition to built flex sources

rdb 5 anos atrás
pai
commit
f8039c0bc8
1 arquivos alterados com 4 adições e 0 exclusões
  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)