Skip to content

Commit

Permalink
Fixes to installation.
Browse files Browse the repository at this point in the history
This change set makes several changes to the installation of AtomVM on the generic_unix platform.

* 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.

Signed-off-by: Fred Dushin <[email protected]>
  • Loading branch information
fadushin committed Oct 8, 2023
1 parent 5c66e69 commit 27e13c1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ option(AVM_USE_32BIT_FLOAT "Use 32 bit floats." OFF)
option(AVM_VERBOSE_ABORT "Print module and line number on VM abort" OFF)
option(AVM_RELEASE "Build an AtomVM release" OFF)
option(AVM_CREATE_STACKTRACES "Create stacktraces" ON)
option(AVM_BUILD_RUNTIME_ONLY "Only build the AtomVM runtime" OFF)
option(COVERAGE "Build for code coverage" OFF)

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

add_subdirectory(tests)
if(NOT AVM_BUILD_RUNTIME_ONLY)
add_subdirectory(tests)
endif()

add_subdirectory(tools/packbeam)
add_subdirectory(tools/uf2tool)

if (NOT "${CMAKE_GENERATOR}" MATCHES "Xcode")
add_custom_target(dialyzer COMMENT "Run dialyzer")
add_subdirectory(libs)
add_subdirectory(examples)
add_subdirectory(doc)
if(NOT AVM_BUILD_RUNTIME_ONLY)
add_subdirectory(examples)
add_subdirectory(doc)
endif()
endif()
1 change: 1 addition & 0 deletions CMakeModules/FindElixir.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
find_program(ELIXIRC_PATH elixirc)

if (ELIXIRC_PATH)
message("Found Elixir")
set(Elixir_FOUND TRUE)
elseif(Elixir_FIND_REQUIRED)
message(FATAL_ERROR "Elixir compiler not found")
Expand Down
1 change: 0 additions & 1 deletion libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,4 @@ endif()
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/atomvmlib.avm
DESTINATION lib/atomvm
RENAME atomvm.avm
)
2 changes: 1 addition & 1 deletion src/platforms/generic_unix/atomvm
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ then
exit 1
fi

exec "${avm_lib}/atomvm/AtomVM" $@ "${avm_lib}/atomvm/atomvm.avm"
exec "${avm_lib}/atomvm/AtomVM" $@ "${avm_lib}/atomvm/atomvmlib.avm"
2 changes: 0 additions & 2 deletions tools/packbeam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ target_link_libraries(PackBEAM PRIVATE libAtomVM${PLATFORM_LIB_SUFFIX})
target_include_directories(PackBEAM PUBLIC ../../src/libAtomVM)
target_link_libraries(PackBEAM PRIVATE libAtomVM)

install(TARGETS PackBEAM DESTINATION bin)

if (COVERAGE)
include(CodeCoverage)
append_coverage_compiler_flags_to_target(PackBEAM)
Expand Down

0 comments on commit 27e13c1

Please sign in to comment.