message: cmake: Separate WABT flags for C and C++ compilation
diff: @@ -11,12 +11,17 @@ set(binary_dir ${prefix}/src/wabt-build)
  set(include_dir ${source_dir})
  set(wabt_library ${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}wabt${CMAKE_STATIC_LIBRARY_SUFFIX})
  -set(flags -fvisibility=hidden)
  +set(CPPFLAGS "-fvisibility=hidden") # Flags for both C and C++ compilation.
  +set(CXXFLAGS "") # Flags for C++ compilation only.
  +
  if(SANITIZE MATCHES address)
  # Instrument WABT with ASan - required for container-overflow checks.
  - set(flags "-D_GLIBCXX_SANITIZE_VECTOR -fsanitize=address ${flags}")
  + set(CPPFLAGS "-fsanitize=address ${CPPFLAGS}")
  + set(CXXFLAGS "-D_GLIBCXX_SANITIZE_VECTOR ${CXXFLAGS}")
  endif()
  +set(CXXFLAGS "${CPPFLAGS} ${CXXFLAGS}")
  +
  if(CMAKE_GENERATOR MATCHES Ninja)
  set(build_command BUILD_COMMAND ${CMAKE_COMMAND} --build . -j4)
  endif()
  @@ -40,8 +45,8 @@ ExternalProject_Add(wabt
  -DBUILD_TESTS=OFF
  -DBUILD_TOOLS=OFF
  -DCMAKE_POSITION_INDEPENDENT_CODE=FALSE
  - -DCMAKE_CXX_FLAGS=${flags}
  - -DCMAKE_C_FLAGS=${flags}
  + -DCMAKE_CXX_FLAGS=${CXXFLAGS}
  + -DCMAKE_C_FLAGS=${CPPFLAGS}
  ${build_command}
  INSTALL_COMMAND ""
  BUILD_BYPRODUCTS ${wabt_library}
  