Skip to content

Commit 80233ac

Browse files
committed
riscv32: fix compilation with JIT disabled on esp32
Signed-off-by: Paul Guyot <[email protected]>
1 parent e594583 commit 80233ac

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/platforms/esp32/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ endif()
5151
# On Esp32, select is run in a loop in a dedicated task
5252
set(AVM_SELECT_IN_TASK ON)
5353

54-
project(atomvm-esp32)
55-
5654
# JIT is only supported on RISC-V targets (ESP32-C2, ESP32-C3, ESP32-C6, ESP32-H2, ESP32-P4)
55+
# Configuration comes from idf.py menuconfig (KConfig), not CMake options
5756
if(CONFIG_JIT_ENABLED)
5857
if (${IDF_TARGET} MATCHES "esp32c2|esp32c3|esp32c6|esp32h2|esp32p4")
5958
set(AVM_DISABLE_JIT OFF)
@@ -68,6 +67,8 @@ else()
6867
message(STATUS "JIT compilation disabled")
6968
endif()
7069

70+
project(atomvm-esp32)
71+
7172
# esp-idf does not use compile_feature but instead sets version in
7273
# c_compile_options
7374
# Ensure project is compiled with at least C11

src/platforms/esp32/components/libatomvm/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ if (HAVE_PLATFORM_ATOMIC_H)
3131
target_include_directories(libAtomVM PUBLIC ../avm_sys/)
3232
endif()
3333

34-
target_link_libraries(${COMPONENT_LIB}
35-
INTERFACE libAtomVM "-u platform_nifs_get_nif" "-u platform_defaultatoms_init" "-u jit_stream_entry_point" "-u sys_map_native_code")
34+
if (AVM_DISABLE_JIT)
35+
target_link_libraries(${COMPONENT_LIB}
36+
INTERFACE libAtomVM "-u platform_nifs_get_nif" "-u platform_defaultatoms_init")
37+
else()
38+
target_link_libraries(${COMPONENT_LIB}
39+
INTERFACE libAtomVM "-u platform_nifs_get_nif" "-u platform_defaultatoms_init" "-u jit_stream_entry_point" "-u sys_map_native_code")
40+
endif()
3641

3742
target_compile_features(${COMPONENT_LIB} INTERFACE c_std_11)

0 commit comments

Comments
 (0)