mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-29 21:42:00 +00:00
Fix Clang-Cl compile on Windows (#7308)
Introduce a MSVC_LIKE variable in the CMake scripts, set that variable to true only if the compiler is either MSVC or tries to emulate the MSVC command line, and test that variable when setting compiler arguments. Tested with cmake .. -G Ninja -DCMAKE_C_COMPILER:PATH="clang-cl.exe" -DCMAKE_CXX_COMPILER:PATH="clang-cl.exe" -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_BUILD_CPP17=ON Co-authored-by: Kaiyi Li <kaiyili@google.com>
This commit is contained in:
@@ -5,8 +5,8 @@ message(STATUS "Conan FlatBuffers Wrapper")
|
||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
conan_basic_setup()
|
||||
|
||||
if (WIN32 AND MSVC AND FLATBUFFERS_BUILD_SHAREDLIB)
|
||||
if (WIN32 AND MSVC_LIKE AND FLATBUFFERS_BUILD_SHAREDLIB)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
endif(WIN32 AND MSVC AND FLATBUFFERS_BUILD_SHAREDLIB)
|
||||
endif(WIN32 AND MSVC_LIKE AND FLATBUFFERS_BUILD_SHAREDLIB)
|
||||
|
||||
include(${CMAKE_SOURCE_DIR}/CMakeListsOriginal.txt)
|
||||
|
||||
Reference in New Issue
Block a user