File tree Expand file tree Collapse file tree 4 files changed +45
-11
lines changed Expand file tree Collapse file tree 4 files changed +45
-11
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ build/**
1010xcode /**
1111src /platforms /esp32 /build /**
1212src /platforms /esp32 /build /** /* .d
13+ src /platforms /esp32 /test /build /**
1314src /platforms /esp32 /components /**
1415src /platforms /esp32 /sdkconfig
1516! src /platforms /esp32 /components /avm_builtins /
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ cmake_minimum_required (VERSION 3.13)
2323project (AtomVM)
2424set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR} /CMakeModules)
2525
26+ find_package (Dialyzer)
2627find_package (Elixir)
2728
2829option (AVM_DISABLE_FP "Disable floating point support." OFF )
@@ -32,6 +33,7 @@ option(AVM_VERBOSE_ABORT "Print module and line number on VM abort" OFF)
3233option (AVM_RELEASE "Build an AtomVM release" OFF )
3334option (AVM_CREATE_STACKTRACES "Create stacktraces" ON )
3435option (COVERAGE "Build for code coverage" OFF )
36+ option (RUN_DIALYZER "Run dialyzer on BEAM modules" ON )
3537
3638if ((${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) OR
3739 (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" ) OR
Original file line number Diff line number Diff line change 1+ #
2+ # This file is part of AtomVM.
3+ #
4+ # Copyright 2019 Riccardo Binetti <[email protected] > 5+ #
6+ # Licensed under the Apache License, Version 2.0 (the "License");
7+ # you may not use this file except in compliance with the License.
8+ # You may obtain a copy of the License at
9+ #
10+ # http://www.apache.org/licenses/LICENSE-2.0
11+ #
12+ # Unless required by applicable law or agreed to in writing, software
13+ # distributed under the License is distributed on an "AS IS" BASIS,
14+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+ # See the License for the specific language governing permissions and
16+ # limitations under the License.
17+ #
18+ # SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
19+ #
20+
21+ find_program (DIALYZER_PATH dialyzer)
22+
23+ if (DIALYZER_PATH)
24+ set (Dialyzer_FOUND TRUE )
25+ elseif (Dialyzer_FIND_REQUIRED)
26+ message (FATAL_ERROR "dialyzer not found" )
27+ endif ()
Original file line number Diff line number Diff line change @@ -40,18 +40,22 @@ else()
4040 pack_lib(atomvmlib eavmlib estdlib alisp)
4141endif ()
4242
43- add_custom_command (
44- OUTPUT ${CMAKE_CURRENT_BINARY_DIR} /atomvmlib.plt
45- DEPENDS atomvmlib
46- COMMAND dialyzer --build_plt --output_plt ${CMAKE_CURRENT_BINARY_DIR} /atomvmlib.plt
47- -r ${CMAKE_CURRENT_BINARY_DIR} /estdlib/src/beams
48- -r ${CMAKE_CURRENT_BINARY_DIR} /eavmlib/src/beams
49- -r ${CMAKE_CURRENT_BINARY_DIR} /alisp/src/beams
50- )
43+ if (Dialyzer_FOUND AND RUN_DIALYZER)
44+ add_custom_command (
45+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR} /atomvmlib.plt
46+ DEPENDS atomvmlib
47+ COMMAND dialyzer --build_plt --output_plt ${CMAKE_CURRENT_BINARY_DIR} /atomvmlib.plt
48+ -r ${CMAKE_CURRENT_BINARY_DIR} /estdlib/src/beams
49+ -r ${CMAKE_CURRENT_BINARY_DIR} /eavmlib/src/beams
50+ -r ${CMAKE_CURRENT_BINARY_DIR} /alisp/src/beams
51+ )
5152
52- add_custom_target (atomvmlib_plt ALL
53- DEPENDS ${CMAKE_CURRENT_BINARY_DIR} /atomvmlib.plt
54- )
53+ add_custom_target (atomvmlib_plt ALL
54+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR} /atomvmlib.plt
55+ )
56+ else ()
57+ message ("Dialyzer is not enabled -- skipping PLT build" )
58+ endif ()
5559
5660install (
5761 FILES ${CMAKE_CURRENT_BINARY_DIR} /atomvmlib.avm
You can’t perform that action at this time.
0 commit comments