Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion cmake/modules/Host.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
set(TEST_SUITE_HOST_CC "cc" CACHE STRING "C compiler targetting the host")

if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows" AND NOT TEST_SUITE_HOST_CC)
set(TEST_SUITE_HOST_CC "clang" CACHE STRING "C compiler targetting the host")
else()
set(TEST_SUITE_HOST_CC "cc" CACHE STRING "C compiler targetting the host")
endif()

mark_as_advanced(TEST_SUITE_HOST_CC)

function(llvm_add_host_executable targetname exename)
Expand All @@ -22,6 +28,11 @@ function(llvm_add_host_executable targetname exename)
list(APPEND _objs ${_objfile})
endforeach ()

# Append ".exe" to the executable name on Windows
if(WIN32)
set(exename "${exename}.exe")
endif()

add_custom_command(OUTPUT ${exename}
COMMAND ${TEST_SUITE_HOST_CC} ${_objs}
-o "${CMAKE_CURRENT_BINARY_DIR}/${exename}" ${_arg_LDFLAGS}
Expand Down
Loading