Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
[POAE7-2488] Fix to select correct gcc toolchain (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
xieqi authored Oct 28, 2022
1 parent 29a0b48 commit 787bdc5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cider/function/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ if(SUPPRESS_NULL_LOGGER_DEPRECATION_WARNINGS)
list(APPEND MAPD_DEFINITIONS "-DSUPPRESS_NULL_LOGGER_DEPRECATION_WARNINGS")
endif()

execute_process(
COMMAND bash -c "realpath -m $(which gcc)/../.."
OUTPUT_VARIABLE GCC_TOOLCHAIN
OUTPUT_STRIP_TRAILING_WHITESPACE)

add_custom_command(
DEPENDS
scalar/RuntimeFunctions.h
Expand All @@ -65,8 +70,9 @@ add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/RuntimeFunctions.bc
COMMAND
${llvm_clangpp_cmd} ARGS -std=c++17 ${RT_OPT_FLAGS} -c -emit-llvm
${CLANG_SDK_INC} ${CLANG_CRT_INC} ${MAPD_DEFINITIONS} -I
${CMAKE_CURRENT_SOURCE_DIR}/../ -I ${CMAKE_CURRENT_SOURCE_DIR}/../include
--gcc-toolchain=${GCC_TOOLCHAIN} ${CLANG_SDK_INC} ${CLANG_CRT_INC}
${MAPD_DEFINITIONS} -I ${CMAKE_CURRENT_SOURCE_DIR}/../ -I
${CMAKE_CURRENT_SOURCE_DIR}/../include
${CMAKE_CURRENT_SOURCE_DIR}/scalar/RuntimeFunctions.cpp)

add_library(cider_function ${function_source_files})
Expand Down

0 comments on commit 787bdc5

Please sign in to comment.