Files
OpenCL-CTS/test_conformance/spir/CMakeLists.txt
Jeremy Kemp 996c353c0e CMake Build: Tidy up when -msse2 is passed to gcc (#622)
* Define CMAKE_ARM_COMPILER automatically (#469)

Makes use of CMAKE_SYSTEM_PROCESSOR to detect whether compilation is happening for an ARM architecture.

* Use the correct guard for specifying msse2 compiler flags.

Bruteforce and conversions were only checking against ANDROID which was not sufficient for ARM Linux builds.

* Remove redundant uses of the msse2 compiler flag.

* Globally set -msse2 for x86/amd64 gcc, Apple and Clang builds.

This is a change in behaviour. Prior to this commit, msse2 was only set for bruteforce and conversions.

msse and mfpmath=sse were already set globally prior to this change.
2020-02-25 08:56:54 +00:00

67 lines
1.5 KiB
CMake

# Import function list from math_brute_force
add_definitions(-DFUNCTION_LIST_ULPS_ONLY)
set(SPIR_OUT ${CONFORMANCE_PREFIX}spir${CONFORMANCE_SUFFIX})
set (SPIR_SOURCES
main.cpp
datagen.cpp
run_build_test.cpp
run_services.cpp
kernelargs.cpp
../math_brute_force/FunctionList.cpp
)
add_executable(${SPIR_OUT}
${SPIR_SOURCES})
if(UNIX)
set_target_properties(${SPIR_OUT} PROPERTIES
COMPILE_FLAGS "-fexceptions -frtti")
elseif(MSVC)
set_target_properties(${SPIR_OUT} PROPERTIES
COMPILE_FLAGS "/GR /EHs /EHc")
endif()
TARGET_LINK_LIBRARIES(${SPIR_OUT} harness
${CLConform_LIBRARIES})
set_source_files_properties(${SPIR_SOURCES} PROPERTIES LANGUAGE CXX)
# Need to copy the spir zips to sit beside the executable
set(SPIR_FILES
"khr.csv"
"api.zip"
"atomics.zip"
"basic.zip"
"compile_and_link.zip"
"commonfns.zip"
"conversions.zip"
"geometrics.zip"
"enum_values.zip"
"half.zip"
"kernel_attributes.zip"
"kernel_image_methods.zip"
"images_kernel_read_write.zip"
"images_samplerlessRead.zip"
"integer_ops.zip"
"math_brute_force.zip"
"printf.zip"
"profiling.zip"
"relationals.zip"
"select.zip"
"sampler_enumeration.zip"
"vec_align.zip"
"vec_step.zip"
"binary_type.zip")
foreach(input_file ${SPIR_FILES})
add_custom_command(
TARGET ${SPIR_OUT}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/${input_file}" "$<TARGET_FILE_DIR:${SPIR_OUT}>/"
)
endforeach(input_file)