Skip to content

Commit 9598611

Browse files
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
1 parent f8f37c8 commit 9598611

File tree

5 files changed

+5
-1
lines changed

5 files changed

+5
-1
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if(ESP_PLATFORM)
88
return()
99
endif()
1010

11-
project (iwasm)
11+
project (iwasm LANGUAGES C)
1212

1313
set(CMAKE_CXX_STANDARD 17)
1414

core/iwasm/compilation/iwasm_compl.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
set (IWASM_COMPL_DIR ${CMAKE_CURRENT_LIST_DIR})
22

33
include_directories(${IWASM_COMPL_DIR})
4+
enable_language(CXX)
45

56
if (WAMR_BUILD_DEBUG_AOT EQUAL 1)
67
file (GLOB_RECURSE source_all

core/iwasm/fast-jit/iwasm_fast_jit.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ if (WAMR_BUILD_FAST_JIT_DUMP EQUAL 1)
99
endif ()
1010

1111
include_directories (${IWASM_FAST_JIT_DIR})
12+
enable_language(CXX)
1213

1314
if (WAMR_BUILD_TARGET STREQUAL "X86_64" OR WAMR_BUILD_TARGET STREQUAL "AMD_64")
1415
include(FetchContent)

core/iwasm/libraries/wasi-nn/cmake/wasi_nn.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ add_compile_definitions(
2222
# - tflite
2323
if(WAMR_BUILD_WASI_NN_TFLITE EQUAL 1)
2424
find_package(tensorflow_lite REQUIRED)
25+
enable_language(CXX)
2526

2627
add_library(
2728
wasi_nn_tflite

core/shared/platform/windows/shared_platform.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ set (PLATFORM_SHARED_DIR ${CMAKE_CURRENT_LIST_DIR})
66
add_definitions(-DBH_PLATFORM_WINDOWS)
77
add_definitions(-DHAVE_STRUCT_TIMESPEC)
88
add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS)
9+
enable_language(CXX)
910

1011
include_directories(${PLATFORM_SHARED_DIR})
1112
include_directories(${PLATFORM_SHARED_DIR}/../include)

0 commit comments

Comments
 (0)