Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix macos builds by avoiding double compilation of function_list.cpp for test_spir #1866

Merged
merged 3 commits into from
Jan 16, 2024
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
16 changes: 3 additions & 13 deletions test_conformance/spir/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand Down
5 changes: 5 additions & 0 deletions test_conformance/spir/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdio.h>
Expand Down
Loading