Files
wamr/core/iwasm/compilation/iwasm_compl.cmake
Xavier Del Campo 9598611e35 CMakeLists.txt: Do not require C++ (#3956)
By default, the project() CMake command defaults to C and C++. [1]
Therefore, CMake might perform tests for both C and C++ compilers as
part of the configuration phase.

However, this has the consequence of the configuration phase to fail if
the system does not have a C++ toolchain installed, even if C++ is not
really used by the top-level project under the default settings.

Some configurations might still require a C++ toolchain, so
enable_language is selectively called under such circumstances.

[1]: https://cmake.org/cmake/help/latest/command/project.html
2024-12-20 13:05:50 +08:00

28 lines
703 B
CMake

set (IWASM_COMPL_DIR ${CMAKE_CURRENT_LIST_DIR})
include_directories(${IWASM_COMPL_DIR})
enable_language(CXX)
if (WAMR_BUILD_DEBUG_AOT EQUAL 1)
file (GLOB_RECURSE source_all
${IWASM_COMPL_DIR}/*.c
${IWASM_COMPL_DIR}/*.cpp)
else()
file (GLOB source_all
${IWASM_COMPL_DIR}/simd/*.c
${IWASM_COMPL_DIR}/simd/*.cpp
${IWASM_COMPL_DIR}/*.c
${IWASM_COMPL_DIR}/*.cpp)
endif()
set (IWASM_COMPL_SOURCE ${source_all})
# Disalbe rtti to works with LLVM
if (MSVC)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-")
else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
endif()