Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreinking committed Aug 14, 2024
1 parent 88701db commit 3563a9f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions cmake/HalideGeneratorHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,8 @@ function(add_halide_library TARGET)

_Halide_get_platform_details(
is_crosscompiling
object_suffix
static_library_suffix
object_extension
static_library_extension
"${common_triple}"
)

Expand Down Expand Up @@ -861,8 +861,8 @@ function(add_halide_runtime RT)

_Halide_get_platform_details(
is_crosscompiling
object_suffix
static_library_suffix
object_extension
static_library_extension
"${common_triple}")

# We defer reading the list of targets for which to generate a common
Expand All @@ -875,7 +875,7 @@ function(add_halide_runtime RT)
set(target_list "$<LIST:TRANSFORM,${target_list},REPLACE,-(user_context|no_asserts|no_bounds_query|no_runtime|profile),>")

if (is_crosscompiling)
set(GEN_OUTS "${RT}${static_library_suffix}")
set(GEN_OUTS "${RT}${static_library_extension}")
add_custom_command(
OUTPUT "${GEN_OUTS}"
COMMAND Halide::GenRT -r "${RT}" -o .
Expand Down Expand Up @@ -907,13 +907,13 @@ function(add_halide_runtime RT)
endif ()

add_custom_command(
OUTPUT "${this_rt}${object_suffix}"
OUTPUT "${this_rt}${object_extension}"
COMMAND Halide::GenRT -r "${this_rt}" -o . -e object
"target=$<JOIN:$<REMOVE_DUPLICATES:${arch_target_list}>,$<COMMA>>"
DEPENDS Halide::GenRT
VERBATIM)

add_library("${this_rt}" STATIC "${this_rt}${object_suffix}")
add_library("${this_rt}" STATIC "${this_rt}${object_extension}")
set_target_properties("${this_rt}" PROPERTIES LINKER_LANGUAGE CXX)
_Halide_fix_xcode("${this_rt}")
_Halide_set_osx_arch("${this_rt}" "${triple}")
Expand All @@ -923,12 +923,12 @@ function(add_halide_runtime RT)
else ()
set(target_list "$<LIST:TRANSFORM,${target_list},REPLACE,cmake,${Halide_CMAKE_TARGET}>")
add_custom_command(
OUTPUT "${RT}${object_suffix}"
OUTPUT "${RT}${object_extension}"
COMMAND Halide::GenRT -r "${RT}" -o . -e object
"target=$<JOIN:$<REMOVE_DUPLICATES:${target_list}>,$<COMMA>>"
DEPENDS Halide::GenRT
VERBATIM)
add_library("${RT}" STATIC "${RT}${object_suffix}")
add_library("${RT}" STATIC "${RT}${object_extension}")
set_target_properties("${RT}" PROPERTIES LINKER_LANGUAGE CXX)
_Halide_fix_xcode("${RT}")
endif ()
Expand All @@ -950,11 +950,11 @@ function(add_halide_runtime RT)
endfunction()

function(_Halide_get_platform_details OUT_XC OUT_OBJ OUT_STATIC triple)
if (triple STREQUAL "host")
if (triple MATCHES "host")
set(triple "${Halide_HOST_TARGET}")
endif ()

if (triple STREQUAL "cmake")
if (triple MATCHES "cmake")
set(triple "${Halide_CMAKE_TARGET}")
set("${OUT_XC}" 0 PARENT_SCOPE)
elseif (triple IN_LIST Halide_CMAKE_TARGET)
Expand Down

0 comments on commit 3563a9f

Please sign in to comment.