From 0a32b5ca9d82fe017637c4faefcd668f6cbdf435 Mon Sep 17 00:00:00 2001 From: Ben Ashbaugh Date: Tue, 16 Jan 2024 09:54:53 -0800 Subject: [PATCH] fix macos builds by avoiding double compilation of function_list.cpp for test_spir (#1866) * modernize CMakeLists for test_spir * add the operating system release to the sccache key * include the math brute force function list vs. building it twice --- test_conformance/spir/CMakeLists.txt | 16 +++------------- test_conformance/spir/main.cpp | 5 +++++ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/test_conformance/spir/CMakeLists.txt b/test_conformance/spir/CMakeLists.txt index f65c0313..1ac49ac3 100644 --- a/test_conformance/spir/CMakeLists.txt +++ b/test_conformance/spir/CMakeLists.txt @@ -1,6 +1,3 @@ -# Import function list from math_brute_force -add_definitions(-DFUNCTION_LIST_ULPS_ONLY) - set(SPIR_OUT ${CONFORMANCE_PREFIX}spir${CONFORMANCE_SUFFIX}) set (SPIR_SOURCES @@ -9,25 +6,18 @@ set (SPIR_SOURCES run_build_test.cpp run_services.cpp kernelargs.cpp - ../math_brute_force/function_list.cpp ) add_executable(${SPIR_OUT} ${SPIR_SOURCES}) if(UNIX) - set_target_properties(${SPIR_OUT} PROPERTIES - COMPILE_FLAGS "-fexceptions -frtti") + target_compile_options(${SPIR_OUT} PRIVATE -fexceptions -frtti) elseif(MSVC) - set_target_properties(${SPIR_OUT} PROPERTIES - COMPILE_FLAGS "/GR /EHs /EHc") + target_compile_options(${SPIR_OUT} PRIVATE /GR /EHs /EHc) endif() -TARGET_LINK_LIBRARIES(${SPIR_OUT} harness - ${CLConform_LIBRARIES}) - - -set_source_files_properties(${SPIR_SOURCES} PROPERTIES LANGUAGE CXX) +target_link_libraries(${SPIR_OUT} harness ${CLConform_LIBRARIES}) # Need to copy the spir zips to sit beside the executable diff --git a/test_conformance/spir/main.cpp b/test_conformance/spir/main.cpp index b02da734..ca02e5c2 100644 --- a/test_conformance/spir/main.cpp +++ b/test_conformance/spir/main.cpp @@ -13,6 +13,11 @@ // See the License for the specific language governing permissions and // limitations under the License. // + +// Import function list from math_brute_force +#define FUNCTION_LIST_ULPS_ONLY +#include "../math_brute_force/function_list.cpp" + #include "harness/compat.h" #include