diff options
author | David Neto <dneto@google.com> | 2018-02-06 19:13:39 +0300 |
---|---|---|
committer | David Neto <dneto@google.com> | 2018-02-06 22:40:28 +0300 |
commit | b1c9c4e8c0f41c4f76e2e1c6f938982b03bd35ee (patch) | |
tree | 7be7e6ce8faac0d178995aa7e15d5e6b59126e63 /external | |
parent | e7fafdaa68a3775be5f2406e91db4b5d3fbc7b35 (diff) |
Enable Visual Studio 2013 again
Disable use of Effcee and RE2 with MSVC compilers older than Visual
Studio 2015 since RE2 doesn't support them.
Diffstat (limited to 'external')
-rw-r--r-- | external/CMakeLists.txt | 70 |
1 files changed, 40 insertions, 30 deletions
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index a43c3f815..da0b2e649 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -66,43 +66,53 @@ if (NOT ${SPIRV_SKIP_TESTS}) endforeach() endif() - # Find Effcee and RE2, for testing. - # Optional for now, but eventually we'll make this required. - - # First find RE2, since Effcee depends on it. - # If already configured, then use that. Otherwise, prefer to find it under 're2' - # in this directory. - if (NOT TARGET re2) - # If we are configuring RE2, then turn off its testing. It takes a long time and - # does not add much value for us. If an enclosing project configured RE2, then it - # has already chosen whether to enable RE2 tesitng. - set(RE2_BUILD_TESTING OFF CACHE STRING "Run RE2 Tests") - if (NOT RE2_SOURCE_DIR) - if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/re2) - set(RE2_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/re2" CACHE STRING "RE2 source dir" ) - endif() + set(SPIRV_ENABLE_EFFCEE ON) + if (MSVC) + if (MSVC_VERSION LESS 1900) + message(STATUS "SPIRV-Tools: Need Visual Studio 2015 or later for Effcee and RE2") + set(SPIRV_ENABLE_EFFCEE OFF) endif() endif() - if (NOT TARGET effcee) - # Expect to find effcee in this directory. - if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/effcee) - # If we're configuring RE2 (via Effcee), then turn off RE2 testing. - if (NOT TARGET re2) - set(RE2_BUILD_TESTING OFF) + if (SPIRV_ENABLE_EFFCEE) + # Find Effcee and RE2, for testing. + # Optional for now, but eventually we'll make this required. + + # First find RE2, since Effcee depends on it. + # If already configured, then use that. Otherwise, prefer to find it under 're2' + # in this directory. + if (NOT TARGET re2) + # If we are configuring RE2, then turn off its testing. It takes a long time and + # does not add much value for us. If an enclosing project configured RE2, then it + # has already chosen whether to enable RE2 tesitng. + set(RE2_BUILD_TESTING OFF CACHE STRING "Run RE2 Tests") + if (NOT RE2_SOURCE_DIR) + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/re2) + set(RE2_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/re2" CACHE STRING "RE2 source dir" ) + endif() endif() - if (MSVC) - # SPIRV-Tools uses the shared CRT with MSVC. Tell Effcee to do the same. - set(EFFCEE_ENABLE_SHARED_CRT ON) + endif() + + if (NOT TARGET effcee) + # Expect to find effcee in this directory. + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/effcee) + # If we're configuring RE2 (via Effcee), then turn off RE2 testing. + if (NOT TARGET re2) + set(RE2_BUILD_TESTING OFF) + endif() + if (MSVC) + # SPIRV-Tools uses the shared CRT with MSVC. Tell Effcee to do the same. + set(EFFCEE_ENABLE_SHARED_CRT ON) + endif() + add_subdirectory(effcee) + set_property(TARGET effcee PROPERTY FOLDER Effcee) + # Turn off warnings for effcee and re2 + set_property(TARGET effcee APPEND PROPERTY COMPILE_OPTIONS -w) + set_property(TARGET re2 APPEND PROPERTY COMPILE_OPTIONS -w) endif() - add_subdirectory(effcee) - set_property(TARGET effcee PROPERTY FOLDER Effcee) - # Turn off warnings for effcee and re2 - set_property(TARGET effcee APPEND PROPERTY COMPILE_OPTIONS -w) - set_property(TARGET re2 APPEND PROPERTY COMPILE_OPTIONS -w) endif() + # TODO(dneto): Eventually, require this. endif() - # TODO(dneto): Eventually, require this. if (TARGET effcee) message(STATUS "SPIRV-Tools: Effcee is configured") else() |