Fix compile errors when building with clang x86_64-pc-windows-msvc (#1038)

This commit is contained in:
Koji KITAYAMA 2022-10-17 07:22:06 +09:00 committed by GitHub
parent 719d5e41a2
commit 8c6963d7ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,8 +36,11 @@ endif()
target_include_directories(pioasm PRIVATE ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_LIST_DIR}/gen)
if (MSVC)
if (MSVC OR
(WIN32 AND NOT MINGW AND (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")))
target_compile_definitions(pioasm PRIVATE YY_NO_UNISTD_H)
endif()
if (MSVC)
target_compile_options(pioasm PRIVATE "/std:c++latest")
endif()