<commit_before>find_package(Qt4)
set(SAFE_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}")
set(SAFE_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
set(CMAKE_REQUIRED_INCLUDES "${QT_INCLUDES}")
set(CMAKE_REQUIRED_LIBRARIES "${QT_QTCORE_LIBRARY}")
CHECK_CXX_SOURCE_COMPILES("#include <QObject>
int main() { QObject o; return 0;}" QT4_USABLE)
mark_as_advanced(QT4_USABLE)
set(CMAKE_REQUIRED_INCLUDES "${SAFE_CMAKE_REQUIRED_INCLUDES}")
set(CMAKE_REQUIRED_LIBRARIES "${SAFE_CMAKE_REQUIRED_LIBRARIES}")

add_custom_target(Examples COMMENT "build all examples" VERBATIM)

# for the remaining targets unconditional Vc_ARCHITECTURE_FLAGS is mostly fine.
add_definitions(${Vc_ARCHITECTURE_FLAGS})

AddCompilerFlag(-ftemplate-depth=1024)

macro(build_example name)
   set(_SRCS)
   set(_LIBS)
   set(_disabled_impl)
   set(_state 1)
   foreach(ARG ${ARGN})
      if(ARG STREQUAL "LIBS")
         set(_state 2)
      elseif(ARG STREQUAL "DISABLE")
         set(_state 3)
      elseif(_state EQUAL 1)
         set(_SRCS ${_SRCS} ${ARG})
      elseif(_state EQUAL 2)
         set(_LIBS ${_LIBS} ${ARG})
      elseif(_state EQUAL 3)
         list(APPEND _disabled_impl ${ARG})
      endif()
   endforeach()
   add_executable("example_${name}_default" ${_SRCS})
   target_link_libraries("example_${name}_default" Vc ${_LIBS})
   add_dependencies(Examples "example_${name}_default")

   list(FIND _disabled_impl "Scalar" _index)
   if(_index EQUAL -1)
      add_executable("example_${name}_scalar" ${_SRCS})
      add_target_property("example_${name}_scalar" COMPILE_FLAGS "-DVC_IMPL=Scalar")
      add_target_property("example_${name}_scalar" LABELS "Scalar")<commit_msg>use Vc_ARCHITECTURE_FLAGS only for the default target<commit_after>find_package(Qt4)
set(SAFE_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}")
set(SAFE_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
set(CMAKE_REQUIRED_INCLUDES "${QT_INCLUDES}")
set(CMAKE_REQUIRED_LIBRARIES "${QT_QTCORE_LIBRARY}")
CHECK_CXX_SOURCE_COMPILES("#include <QObject>
int main() { QObject o; return 0;}" QT4_USABLE)
mark_as_advanced(QT4_USABLE)
set(CMAKE_REQUIRED_INCLUDES "${SAFE_CMAKE_REQUIRED_INCLUDES}")
set(CMAKE_REQUIRED_LIBRARIES "${SAFE_CMAKE_REQUIRED_LIBRARIES}")

add_custom_target(Examples COMMENT "build all examples" VERBATIM)

AddCompilerFlag(-ftemplate-depth=1024)

macro(build_example name)
   set(_SRCS)
   set(_LIBS)
   set(_disabled_impl)
   set(_state 1)
   foreach(ARG ${ARGN})
      if(ARG STREQUAL "LIBS")
         set(_state 2)
      elseif(ARG STREQUAL "DISABLE")
         set(_state 3)
      elseif(_state EQUAL 1)
         set(_SRCS ${_SRCS} ${ARG})
      elseif(_state EQUAL 2)
         set(_LIBS ${_LIBS} ${ARG})
      elseif(_state EQUAL 3)
         list(APPEND _disabled_impl ${ARG})
      endif()
   endforeach()
   add_executable("example_${name}_default" ${_SRCS})
   add_target_property("example_${name}_default" COMPILE_FLAGS "${Vc_ARCHITECTURE_FLAGS}")
   target_link_libraries("example_${name}_default" Vc ${_LIBS})
   add_dependencies(Examples "example_${name}_default")

   list(FIND _disabled_impl "Scalar" _index)
   if(_index EQUAL -1)
      add_executable("example_${name}_scalar" ${_SRCS})
      add_target_property("example_${name}_scalar" COMPILE_FLAGS "-DVC_IMPL=Scalar")
      add_target_property("example_${name}_scalar" LABELS "Scalar")
{'fraction_non_alphanumeric': 0.1210400478182905, 'fraction_numerical': 0.008965929468021518, 'mean_word_length': 5.858606557377049, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '81612', 'n_tokens_mistral': 1295, 'n_tokens_neox': 1238, 'n_words': 200}