-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce VM size by supporting compilers from 3 last OTP releases
Update few CI tests to optimize VM for the tested OTP version Fix accordingly conditions for following opcodes: - OP_BS_MATCH_STRING is generated by at least OTP 21 to 27 - OP_BS_TEST_UNIT is generated by at least OTP 21 to 25 Signed-off-by: Paul Guyot <[email protected]>
- Loading branch information
Showing
18 changed files
with
182 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# | ||
# This file is part of AtomVM. | ||
# | ||
# Copyright 2025 Paul Guyot <[email protected]> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later | ||
# | ||
|
||
cmake_minimum_required(VERSION 3.13) | ||
|
||
find_program(ERLC_EXECUTABLE erlc) | ||
find_program(ERL_EXECUTABLE erl) | ||
|
||
if (ERLC_EXECUTABLE AND ERL_EXECUTABLE) | ||
execute_process(COMMAND erl -eval "io:put_chars(erlang:system_info(otp_release))." -s init stop -noshell OUTPUT_VARIABLE Erlang_VERSION) | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
if (CMAKE_VERSION VERSION_LESS 3.19) | ||
# Handle version range ourselves | ||
if (Erlang_FIND_VERSION AND ERL_EXECUTABLE) | ||
string(REPLACE "..." ";" Erlang_FIND_VERSION_LIST ${Erlang_FIND_VERSION}) | ||
list(LENGTH Erlang_FIND_VERSION_LIST Erlang_FIND_VERSION_LIST_LEN) | ||
if (Erlang_FIND_VERSION_LIST_LEN EQUAL 1) | ||
find_package_handle_standard_args(Erlang | ||
FOUND_VAR Erlang_FOUND | ||
REQUIRED_VARS ERLC_EXECUTABLE ERL_EXECUTABLE | ||
VERSION_VAR Erlang_VERSION | ||
) | ||
elseif(${Erlang_FIND_VERSION_LIST_LEN} EQUAL 2) | ||
list(GET Erlang_FIND_VERSION_LIST 0 Erlang_FIND_VERSION_MIN) | ||
list(GET Erlang_FIND_VERSION_LIST 1 Erlang_FIND_VERSION_MAX) | ||
if (${Erlang_VERSION} LESS Erlang_FIND_VERSION_MIN) | ||
message(FATAL_ERROR "-- Found Erlang: ${ERL_EXECUTABLE} but OTP Release ${Erlang_VERSION} is less than required ${Erlang_FIND_VERSION_MIN}") | ||
endif() | ||
if (${Erlang_VERSION} GREATER Erlang_FIND_VERSION_MAX) | ||
message(FATAL_ERROR "-- Found Erlang: ${ERL_EXECUTABLE} but OTP Release ${Erlang_VERSION} is greater than supported ${Erlang_FIND_VERSION_MAX}") | ||
endif() | ||
find_package_handle_standard_args(Erlang | ||
FOUND_VAR Erlang_FOUND | ||
REQUIRED_VARS ERLC_EXECUTABLE ERL_EXECUTABLE | ||
) | ||
else() | ||
message(FATAL_ERROR "-- Found Erlang: ${ERL_EXECUTABLE} but version range syntax is incorrect ${Erlang_FIND_VERSION}") | ||
endif() | ||
else() | ||
find_package_handle_standard_args(Erlang | ||
FOUND_VAR Erlang_FOUND | ||
REQUIRED_VARS ERLC_EXECUTABLE ERL_EXECUTABLE | ||
) | ||
endif() | ||
else() | ||
find_package_handle_standard_args(Erlang | ||
FOUND_VAR Erlang_FOUND | ||
HANDLE_VERSION_RANGE | ||
REQUIRED_VARS ERLC_EXECUTABLE ERL_EXECUTABLE | ||
VERSION_VAR Erlang_VERSION | ||
) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.