summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 4 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 40119e06..ed5ecc73 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,11 +14,12 @@
# limitations under the License.
#
-cmake_minimum_required(VERSION 3.0.0)
+cmake_minimum_required(VERSION 3.1.0)
project(WABT LANGUAGES C CXX VERSION 1.0.28)
include(GNUInstallDirs)
-set(CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
@@ -131,7 +132,6 @@ if (COMPILER_IS_MSVC)
# disable warnings C4267 and C4244: conversion/truncation from larger to smaller type.
# disable warning C4800: implicit conversion from larger int to bool
add_definitions(-W3 -wd4018 -wd4056 -wd4756 -wd4267 -wd4244 -wd4800 -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS)
- add_definitions(/std:c++${CXX_STANDARD})
if (NOT WITH_EXCEPTIONS)
# disable exception use in C++ library
@@ -154,7 +154,7 @@ else ()
)
set(CMAKE_CXX_EXTENSIONS OFF)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++${CXX_STANDARD} -Wold-style-cast")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wold-style-cast")
if (NOT WITH_EXCEPTIONS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
@@ -419,8 +419,6 @@ function(wabt_executable)
add_executable(${EXE_NAME} ${EXE_SOURCES})
add_dependencies(everything ${EXE_NAME})
target_link_libraries(${EXE_NAME} ${EXE_LIBS})
- set_property(TARGET ${EXE_NAME} PROPERTY CXX_STANDARD ${CXX_STANDARD})
- set_property(TARGET ${EXE_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
if (EMSCRIPTEN)
# build to JS for now, as node.js doesn't have code caching for wasm yet,