diff --git a/wamr-compiler/CMakeLists.txt b/wamr-compiler/CMakeLists.txt index d38157fb..978b4e0a 100644 --- a/wamr-compiler/CMakeLists.txt +++ b/wamr-compiler/CMakeLists.txt @@ -226,6 +226,7 @@ if (NOT MSVC) endif() if (NOT (MSVC OR CMAKE_C_COMPILER MATCHES ".*clang.*" OR CMAKE_C_COMPILER_ID MATCHES ".*Clang")) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-z,noexecstack,-z,relro,-z,now") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,noexecstack,-z,relro,-z,now") endif() # We disable these flags by default to stay the same with wasm runtime