Skip to content

Commit 444b166

Browse files
committed
Allow using the GetVersion.cmake file for any platform
Changes GetVersion.cmake to allow use by platforms other than generic_unix, by allowing the cmake include of version.cmake before including GetVersion.cmake on other platforms. Fix version reporting for ESP32 builds when executing mkimage.sh by including the AtomVM/version.cmake and AtomVM/CMakeModules/GetVersion.cmake files to be able to get the correct version number when reporting build information during build/mkimage.sh execution. Signed-off-by: Winford <[email protected]>
1 parent 68046e7 commit 444b166

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CMakeModules/GetVersion.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
1919
#
2020

21-
include(${CMAKE_SOURCE_DIR}/version.cmake)
21+
if (!ATOMVM_BASE_VERSION)
22+
include(${CMAKE_SOURCE_DIR}/version.cmake)
23+
endif()
2224

2325
if (ATOMVM_DEV)
2426
set(ATOMVM_GIT_REVISION "<unknown>")

src/platforms/esp32/tools/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
cmake_minimum_required (VERSION 3.13)
2222
project (ReleaseEsp32)
23+
include(../../../../version.cmake)
24+
include(../../../../CMakeModules/GetVersion.cmake)
2325

2426
## Build image tools for target chip
2527

@@ -62,7 +64,7 @@ file(COPY ${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/flash.sh
6264
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
6365
)
6466

65-
if (NOT EXISTS ../../../../build/libs/esp32boot/esp32boot.avm)
67+
if (NOT EXISTS ../../../../build/libs/esp32boot/${BOOT_LIBS})
6668
message(WARNING "A generic_unix build must be done first in the top level AtomVM/build directory! \n\
6769
Consult https://doc.atomvm.org/main/build-instructions.html for build instructions.")
6870
endif()

0 commit comments

Comments
 (0)