CMake: fix clang-cl builds on Windows
Broke this in https://dawn-review.googlesource.com/c/tint/+/45621 We don't want /MP enabled for clang-cl builds as this results in an unused parameter /MP warning. Also opportunistically clean up CMake script a little. Bug: tint:665 Change-Id: I4047b75332c1aa64b32b695dfe050c255009e922 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/45820 Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
parent
f43643f19b
commit
88d3d2e1de
|
@ -84,11 +84,6 @@ if (MSVC)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Enable msbuild multiprocessor builds
|
|
||||||
if (MSVC)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (${TINT_CHECK_CHROMIUM_STYLE})
|
if (${TINT_CHECK_CHROMIUM_STYLE})
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -add-plugin -Xclang find-bad-constructs")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -add-plugin -Xclang find-bad-constructs")
|
||||||
endif()
|
endif()
|
||||||
|
@ -97,13 +92,22 @@ if (${TINT_BUILD_SPV_READER})
|
||||||
include_directories("${PROJECT_SOURCE_DIR}/third_party/spirv-tools/include")
|
include_directories("${PROJECT_SOURCE_DIR}/third_party/spirv-tools/include")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR
|
if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC"))
|
||||||
("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") OR
|
set(COMPILER_IS_CLANG_CL TRUE)
|
||||||
(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") AND
|
endif()
|
||||||
(NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")))
|
|
||||||
|
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR
|
||||||
|
(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") OR
|
||||||
|
((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND
|
||||||
|
(NOT COMPILER_IS_CLANG_CL)))
|
||||||
set(COMPILER_IS_LIKE_GNU TRUE)
|
set(COMPILER_IS_LIKE_GNU TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Enable msbuild multiprocessor builds
|
||||||
|
if (MSVC AND NOT COMPILER_IS_CLANG_CL)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(${TINT_BUILD_DOCS})
|
if(${TINT_BUILD_DOCS})
|
||||||
find_package(Doxygen)
|
find_package(Doxygen)
|
||||||
if(DOXYGEN_FOUND)
|
if(DOXYGEN_FOUND)
|
||||||
|
|
Loading…
Reference in New Issue