Skip to content

Commit c32b712

Browse files
authored
Fix toit.cmake. (#37)
1 parent 09afd5d commit c32b712

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

tools/toit.cmake

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ endif()
3232

3333
# Creates a custom command to build ${TARGET} with correct dependencies.
3434
function(ADD_TOIT_SNAPSHOT SOURCE TARGET DEP_FILE ENV)
35-
if (NOT DEFINED TOITC)
36-
set(TOITC "$ENV{TOITC}")
37-
if ("${TOITC}" STREQUAL "")
38-
# TOITC is normally set to the toit.compile executable.
35+
if (NOT DEFINED TOIT)
36+
set(TOIT "$ENV{TOIT}")
37+
if ("${TOIT}" STREQUAL "")
38+
# TOIT is normally set to the toit executable.
3939
# However, for cross-compilation the compiler must be provided manually.
40-
message(FATAL_ERROR "TOITC not provided")
40+
message(FATAL_ERROR "TOIT not provided")
4141
endif()
4242
endif()
4343
if(POLICY CMP0116)
@@ -47,7 +47,13 @@ function(ADD_TOIT_SNAPSHOT SOURCE TARGET DEP_FILE ENV)
4747
OUTPUT "${TARGET}"
4848
DEPFILE ${DEP_FILE}
4949
DEPENDS download_packages "${SOURCE}"
50-
COMMAND ${CMAKE_COMMAND} -E env ${ENV} ASAN_OPTIONS=detect_leaks=false "${TOITC}" --dependency-file "${DEP_FILE}" --dependency-format ninja -w "${TARGET}" "${SOURCE}"
50+
COMMAND ${CMAKE_COMMAND} -E env ${ENV} ASAN_OPTIONS=detect_leaks=false
51+
"${TOIT}" compile
52+
--snapshot
53+
--dependency-file "${DEP_FILE}"
54+
--dependency-format ninja
55+
-o "${TARGET}"
56+
"${SOURCE}"
5157
)
5258
endfunction(ADD_TOIT_SNAPSHOT)
5359

@@ -70,7 +76,6 @@ function(ADD_TOIT_EXE SOURCE TARGET DEP_FILE ENV)
7076
DEPENDS download_packages "${SOURCE}"
7177
COMMAND ${CMAKE_COMMAND} -E env ${ENV} ASAN_OPTIONS=detect_leaks=false
7278
"${TOIT}" compile
73-
--snapshot
7479
--dependency-file "${DEP_FILE}"
7580
--dependency-format ninja
7681
-o "${TARGET}"

0 commit comments

Comments
 (0)