Files
TheRock/compiler/amd-llvm/clang/unittests/Interpreter/CMakeLists.txt
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

139 lines
3.6 KiB
CMake

if(EMSCRIPTEN)
set(LLVM_COMPONENTS_TO_LINK
""
)
set(LLVM_LIBS_TO_LINK
""
)
set(CLANG_LIBS_TO_LINK
clangInterpreter
)
else()
set(LLVM_COMPONENTS_TO_LINK
${LLVM_TARGETS_TO_BUILD}
Core
MC
OrcJIT
Support
TargetParser
)
set(LLVM_LIBS_TO_LINK
LLVMTestingSupport
)
set(CLANG_LIBS_TO_LINK
clangAST
clangBasic
clangInterpreter
clangFrontend
clangSema
)
endif()
set(CLANG_REPL_TEST_SOURCES
IncrementalCompilerBuilderTest.cpp
IncrementalProcessingTest.cpp
InterpreterTest.cpp
InterpreterExtensionsTest.cpp
CodeCompletionTest.cpp
)
if(TARGET compiler-rt AND LLVM_ON_UNIX)
list(APPEND CLANG_REPL_TEST_SOURCES
OutOfProcessInterpreterTests.cpp
)
message(STATUS "Compiler-RT found, enabling out of process JIT tests")
endif()
add_distinct_clang_unittest(ClangReplInterpreterTests
${CLANG_REPL_TEST_SOURCES}
PARTIAL_SOURCES_INTENDED
EXPORT_SYMBOLS
CLANG_LIBS
${CLANG_LIBS_TO_LINK}
LINK_LIBS
${LLVM_LIBS_TO_LINK}
LLVM_COMPONENTS
${LLVM_COMPONENTS_TO_LINK}
)
if(TARGET compiler-rt AND LLVM_ON_UNIX)
add_dependencies(ClangReplInterpreterTests
llvm-jitlink-executor
compiler-rt
)
message(STATUS "Adding dependency on compiler-rt for out of process JIT tests")
endif()
if(EMSCRIPTEN)
# Without the above you try to link to LLVMSupport twice, and end
# up with a duplicate symbol error when creating the main module
get_target_property(LINKED_LIBS ClangReplInterpreterTests LINK_LIBRARIES)
list(REMOVE_ITEM LINKED_LIBS LLVMSupport)
set_target_properties(ClangReplInterpreterTests PROPERTIES LINK_LIBRARIES "${LINKED_LIBS}")
target_link_options(ClangReplInterpreterTests
PUBLIC "SHELL: -s MAIN_MODULE=1"
PUBLIC "SHELL: -s ALLOW_MEMORY_GROWTH=1"
PUBLIC "SHELL: -s STACK_SIZE=32mb"
PUBLIC "SHELL: -s INITIAL_MEMORY=128mb"
PUBLIC "SHELL: --emrun"
PUBLIC "SHELL: -Wl,--export=__clang_Interpreter_SetValueWithAlloc"
PUBLIC "SHELL: -Wl,--export=__clang_Interpreter_SetValueNoAlloc"
PUBLIC "SHELL: -Wl,--export=_ZnwmPv26__clang_Interpreter_NewTag"
PUBLIC "SHELL: -Wl,--export=_Z9getGlobalv"
PUBLIC "SHELL: -Wl,--export=_Z9setGlobali"
)
set_target_properties(ClangReplInterpreterTests PROPERTIES
SUFFIX ".html"
)
endif()
# Exceptions on Windows are not yet supported.
if(NOT WIN32)
add_subdirectory(ExceptionTests)
endif()
if(MSVC)
set_target_properties(ClangReplInterpreterTests PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS 1)
# RTTI/C++ symbols
set(ClangReplInterpreterTests_exports ${ClangReplInterpreterTests_exports} ??_7type_info@@6B@
?__type_info_root_node@@3U__type_info_node@@A
?nothrow@std@@3Unothrow_t@1@B
)
# Compiler added symbols for static variables. NOT for VStudio < 2015
set(ClangReplInterpreterTests_exports ${ClangReplInterpreterTests_exports} _Init_thread_abort _Init_thread_epoch
_Init_thread_footer _Init_thread_header _tls_index
)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
# new/delete variants needed when linking to static msvc runtime (esp. Debug)
set(ClangReplInterpreterTests_exports ${ClangReplInterpreterTests_exports}
??2@YAPEAX_K@Z
??3@YAXPEAX@Z
??_U@YAPEAX_K@Z
??_V@YAXPEAX@Z
??3@YAXPEAX_K@Z
)
else()
set(ClangReplInterpreterTests_exports ${ClangReplInterpreterTests_exports}
??2@YAPAXI@Z
??3@YAXPAX@Z
??3@YAXPAXI@Z
??_U@YAPAXI@Z
??_V@YAXPAX@Z
??_V@YAXPAXI@Z
)
endif()
# List to '/EXPORT:sym0 /EXPORT:sym1 /EXPORT:sym2 ...'
list(TRANSFORM ClangReplInterpreterTests_exports PREPEND "LINKER:/EXPORT:")
set_property(TARGET ClangReplInterpreterTests APPEND PROPERTY LINK_OPTIONS ${ClangReplInterpreterTests_exports})
endif(MSVC)