Use static catch2.lib instead of catch2.dll (#2419)

* Use static catch2.lib instead of catch2.dll

Using catch2.dll incraeses execution time by 12x

* handle debug option for static catch2

* SWDEV-573539 - skip atomics on windows since its taking a very long time to execute

mlsejenkins needs newer cmake but compiler breaks with newer versions
so skipping on windows can be a workaround for now

---------

Co-authored-by: Joseph Macaranas <145489236+jayhawk-commits@users.noreply.github.com>
Tento commit je obsažen v:
Ajay GunaShekar
2026-01-07 14:35:25 -08:00
odevzdal GitHub
rodič 5be4fddf06
revize 95ab459a4c
2 změnil soubory, kde provedl 13 přidání a 2 odebrání
+12 -1
Zobrazit soubor
@@ -8,6 +8,9 @@ option(BUILD_UNIT_TESTS "Build unit tests" ON)
option(BUILD_PERF_TESTS "Build perf tests" OFF)
option(BUILD_STRESS_TESTS "Build stress tests" OFF)
option(TEST_CLOCK_CYCLE "Option to use clock64" OFF)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -110,6 +113,14 @@ if(Catch2_FOUND)
set(CATCH_ADD_TESTS_SCRIPT ${Catch2_DIR}/CatchAddTests.cmake)
file(GLOB CATCH_LIBS "${Catch2_DIR}/../../*Catch2*")
else()
# On Windows, ensure Catch2 uses the same MSVC runtime library and build configuration as our tests
if(WIN32)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build static libraries" FORCE)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>" CACHE STRING "MSVC runtime library" FORCE)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(win_disable_warnings -fms-runtime-lib=static_dbg)
endif()
endif()
# Setup catch2 manually
include(FetchContent)
FetchContent_Declare(
@@ -165,7 +176,7 @@ endif()
if(HIP_PLATFORM STREQUAL "amd")
if(WIN32)
set(win_disable_warnings -Wno-ignored-attributes -Wno-microsoft-cast)
set(win_disable_warnings ${win_disable_warnings} -Wno-ignored-attributes -Wno-microsoft-cast)
endif()
add_compile_options(${HIP_PATH_OPT} -std=c++17 -x hip -Wall -Wextra -Wvla -Wno-deprecated -Wno-option-ignored -Wno-unused-parameter ${win_disable_warnings}) # -Werror)
endif()
+1 -1
Zobrazit soubor
@@ -45,13 +45,13 @@ add_subdirectory(module)
add_subdirectory(channelDescriptor)
add_subdirectory(executionControl)
add_subdirectory(vector_types)
add_subdirectory(atomics)
add_subdirectory(complex)
add_subdirectory(p2p)
add_subdirectory(threadfence)
add_subdirectory(virtualMemoryManagement)
# TODO Rock build failures
if(UNIX)
add_subdirectory(atomics)
add_subdirectory(math)
# TODO compute build failures
add_subdirectory(deviceLib)