Skip to content

Commit 7c909a3

Browse files
committed
Merge pull request #867 from fadushin/install-fixes
Installation Changes This PR makes several changes to the installation of AtomVM on the `generic_unix` platform. This changes include: * A new CMake flag `AVM_BUILD_RUNTIME_ONLY` has been added (defaults to `off`), which when enabled will tell the build to only build the AtomVM binary and libraries. This can significantly shorten build times for systems that build AtomVM (e.g., Homebrew), as it excludes the builds of tests and examples. * The PackBEAM tool is no longer installed. The PackBEAM tool is not well suited towards end-users, and is generally used as an internal build too. Users should be directed to use the rebar3 and mix plugins for development work. * The `atomvmlib.avm` is no longer renamed by the installer, for clarity and better tracking. These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents a5a2fa6 + 27e13c1 commit 7c909a3

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

CMakeLists.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ option(AVM_USE_32BIT_FLOAT "Use 32 bit floats." OFF)
3232
option(AVM_VERBOSE_ABORT "Print module and line number on VM abort" OFF)
3333
option(AVM_RELEASE "Build an AtomVM release" OFF)
3434
option(AVM_CREATE_STACKTRACES "Create stacktraces" ON)
35+
option(AVM_BUILD_RUNTIME_ONLY "Only build the AtomVM runtime" OFF)
3536
option(COVERAGE "Build for code coverage" OFF)
3637

3738
if((${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") OR
@@ -42,13 +43,18 @@ else()
4243
message(FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_NAME}")
4344
endif()
4445

45-
add_subdirectory(tests)
46+
if(NOT AVM_BUILD_RUNTIME_ONLY)
47+
add_subdirectory(tests)
48+
endif()
49+
4650
add_subdirectory(tools/packbeam)
4751
add_subdirectory(tools/uf2tool)
4852

4953
if (NOT "${CMAKE_GENERATOR}" MATCHES "Xcode")
5054
add_custom_target(dialyzer COMMENT "Run dialyzer")
5155
add_subdirectory(libs)
52-
add_subdirectory(examples)
53-
add_subdirectory(doc)
56+
if(NOT AVM_BUILD_RUNTIME_ONLY)
57+
add_subdirectory(examples)
58+
add_subdirectory(doc)
59+
endif()
5460
endif()

CMakeModules/FindElixir.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
find_program(ELIXIRC_PATH elixirc)
2222

2323
if (ELIXIRC_PATH)
24+
message("Found Elixir")
2425
set(Elixir_FOUND TRUE)
2526
elseif(Elixir_FIND_REQUIRED)
2627
message(FATAL_ERROR "Elixir compiler not found")

libs/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,4 @@ endif()
5959
install(
6060
FILES ${CMAKE_CURRENT_BINARY_DIR}/atomvmlib.avm
6161
DESTINATION lib/atomvm
62-
RENAME atomvm.avm
6362
)

src/platforms/generic_unix/atomvm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ then
2929
exit 1
3030
fi
3131

32-
exec "${avm_lib}/atomvm/AtomVM" $@ "${avm_lib}/atomvm/atomvm.avm"
32+
exec "${avm_lib}/atomvm/AtomVM" $@ "${avm_lib}/atomvm/atomvmlib.avm"

tools/packbeam/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ target_link_libraries(PackBEAM PRIVATE libAtomVM${PLATFORM_LIB_SUFFIX})
5353
target_include_directories(PackBEAM PUBLIC ../../src/libAtomVM)
5454
target_link_libraries(PackBEAM PRIVATE libAtomVM)
5555

56-
install(TARGETS PackBEAM DESTINATION bin)
57-
5856
if (COVERAGE)
5957
include(CodeCoverage)
6058
append_coverage_compiler_flags_to_target(PackBEAM)

0 commit comments

Comments
 (0)