Skip to content

Commit

Permalink
Fix FreeBSD build
Browse files Browse the repository at this point in the history
  • Loading branch information
nurmukhametov committed Oct 18, 2024
1 parent 7d63030 commit 049a3d2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmake/Stdlib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,15 @@ function(write_stdlib_bitcode_lib name target os bit out_arch out_os)
string(REPLACE "-" "_" target ${target})
file(APPEND ${CMAKE_BINARY_DIR}/bitcode_libs_generated.cpp
"static BitcodeLib ${name}(BitcodeLib::BitcodeLibType::Stdlib, \"${name}.bc\", ISPCTarget::${target}, TargetOS::${fixed_os}, Arch::${fixed_arch});\n")
if ("${fixed_os}" STREQUAL "linux" AND APPLE AND NOT ISPC_LINUX_TARGET)
set(fixed_os "macos")
if ("${fixed_os}" STREQUAL "linux" AND NOT ISPC_LINUX_TARGET)
# If ISPC_LINUX_TARGET is disabled then we can't run ispc-slim with
# --target-os=linux to generate stdlib bitcode. So we need pass the
# target-os that is supported by ispc-slim.
if (APPLE)
set(fixed_os "macos")
elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(fixed_os "freebsd")
endif()
endif()
set(${out_os} ${fixed_os} PARENT_SCOPE)
set(${out_arch} ${fixed_arch} PARENT_SCOPE)
Expand Down

0 comments on commit 049a3d2

Please sign in to comment.