2024-06-11 10:30:18 +03:00
|
|
|
# primitives
|
|
|
|
|
|
|
|
set(PRIMITIVES_SRCS
|
|
|
|
prim_add.c
|
2024-06-17 12:51:03 +03:00
|
|
|
prim_add.h
|
2024-06-11 10:30:18 +03:00
|
|
|
prim_andor.c
|
2024-06-17 12:51:03 +03:00
|
|
|
prim_andor.h
|
2024-06-11 10:30:18 +03:00
|
|
|
prim_alphaComp.c
|
2024-06-17 12:51:03 +03:00
|
|
|
prim_alphaComp.h
|
2024-06-11 10:30:18 +03:00
|
|
|
prim_colors.c
|
2024-06-17 12:51:03 +03:00
|
|
|
prim_colors.h
|
2024-06-11 10:30:18 +03:00
|
|
|
prim_copy.c
|
2024-06-11 10:51:29 +03:00
|
|
|
prim_copy.h
|
2024-06-11 10:30:18 +03:00
|
|
|
prim_set.c
|
2024-06-17 12:51:03 +03:00
|
|
|
prim_set.h
|
2024-06-11 10:30:18 +03:00
|
|
|
prim_shift.c
|
2024-06-17 12:51:03 +03:00
|
|
|
prim_shift.h
|
2024-06-11 10:30:18 +03:00
|
|
|
prim_sign.c
|
2024-06-17 12:51:03 +03:00
|
|
|
prim_sign.h
|
2024-06-11 10:30:18 +03:00
|
|
|
prim_YUV.c
|
2024-06-17 12:51:03 +03:00
|
|
|
prim_YUV.h
|
2024-06-11 10:30:18 +03:00
|
|
|
prim_YCoCg.c
|
2024-06-17 12:51:03 +03:00
|
|
|
prim_YCoCg.h
|
2024-06-11 10:30:18 +03:00
|
|
|
primitives.c
|
|
|
|
prim_internal.h)
|
|
|
|
|
2024-06-17 12:51:03 +03:00
|
|
|
set(PRIMITIVES_SSE2_SRCS
|
|
|
|
sse/prim_colors_sse2.c
|
|
|
|
sse/prim_set_sse2.c
|
|
|
|
)
|
|
|
|
|
|
|
|
set(PRIMITIVES_SSE3_SRCS
|
|
|
|
sse/prim_add_sse3.c
|
|
|
|
sse/prim_alphaComp_sse3.c
|
|
|
|
sse/prim_andor_sse3.c
|
|
|
|
sse/prim_shift_sse3.c
|
|
|
|
)
|
|
|
|
|
|
|
|
set(PRIMITIVES_SSSE3_SRCS
|
|
|
|
sse/prim_YUV_ssse3.c
|
|
|
|
sse/prim_sign_ssse3.c
|
|
|
|
sse/prim_YCoCg_ssse3.c
|
|
|
|
)
|
|
|
|
|
|
|
|
set(PRIMITIVES_SSE4_1_SRCS
|
|
|
|
sse/prim_copy_sse4_1.c
|
|
|
|
)
|
|
|
|
|
|
|
|
set(PRIMITIVES_SSE4_2_SRCS
|
|
|
|
)
|
|
|
|
|
|
|
|
set(PRIMITIVES_AVX2_SRCS
|
|
|
|
sse/prim_copy_avx2.c
|
|
|
|
)
|
|
|
|
|
|
|
|
set(PRIMITIVES_NEON_SRCS
|
|
|
|
neon/prim_colors_neon.c
|
|
|
|
neon/prim_YCoCg_neon.c
|
|
|
|
neon/prim_YUV_neon.c
|
|
|
|
)
|
|
|
|
|
|
|
|
set(PRIMITIVES_OPENCL_SRCS
|
|
|
|
opencl/prim_YUV_opencl.c
|
|
|
|
)
|
2024-06-11 10:30:18 +03:00
|
|
|
|
|
|
|
if (WITH_OPENCL)
|
|
|
|
freerdp_include_directory_add(${OpenCL_INCLUDE_DIRS})
|
|
|
|
freerdp_library_add(OpenCL::OpenCL)
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(PRIMITIVES_OPT_SRCS
|
2024-06-17 12:51:03 +03:00
|
|
|
${PRIMITIVES_NEON_SRCS}
|
2024-06-11 10:30:18 +03:00
|
|
|
${PRIMITIVES_SSE2_SRCS}
|
|
|
|
${PRIMITIVES_SSE3_SRCS}
|
|
|
|
${PRIMITIVES_SSSE3_SRCS}
|
2024-06-17 12:51:03 +03:00
|
|
|
${PRIMITIVES_SSE4_1_SRCS}
|
|
|
|
${PRIMITIVES_SSE4_2_SRCS}
|
|
|
|
${PRIMITIVES_AVX2_SRCS}
|
2024-06-11 10:30:18 +03:00
|
|
|
${PRIMITIVES_OPENCL_SRCS})
|
|
|
|
|
|
|
|
set(PRIMITIVES_SRCS ${PRIMITIVES_SRCS} ${PRIMITIVES_OPT_SRCS})
|
|
|
|
|
2024-06-17 12:51:03 +03:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
2024-06-11 10:30:18 +03:00
|
|
|
add_library(freerdp-primitives OBJECT
|
|
|
|
${PRIMITIVES_SRCS}
|
|
|
|
)
|
|
|
|
|
|
|
|
if(WITH_SSE2)
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCC OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
|
|
|
if(PRIMITIVES_SSE2_SRCS)
|
|
|
|
set_source_files_properties(${PRIMITIVES_SSE2_SRCS} PROPERTIES COMPILE_FLAGS "-msse2" )
|
|
|
|
endif()
|
|
|
|
if (PRIMITIVES_SSE3_SRCS)
|
|
|
|
set_source_files_properties(${PRIMITIVES_SSE3_SRCS} PROPERTIES COMPILE_FLAGS "-msse3" )
|
|
|
|
endif()
|
|
|
|
if (PRIMITIVES_SSSE3_SRCS)
|
|
|
|
set_source_files_properties(${PRIMITIVES_SSSE3_SRCS} PROPERTIES COMPILE_FLAGS "-mssse3" )
|
|
|
|
endif()
|
2024-06-17 12:51:03 +03:00
|
|
|
if (PRIMITIVES_SSE4_1_SRCS)
|
|
|
|
set_source_files_properties(${PRIMITIVES_SSE4_1_SRCS} PROPERTIES COMPILE_FLAGS "-msse4.1" )
|
|
|
|
endif()
|
|
|
|
if (PRIMITIVES_SSE4_2_SRCS)
|
|
|
|
set_source_files_properties(${PRIMITIVES_SSE4_2_SRCS} PROPERTIES COMPILE_FLAGS "-msse4.2" )
|
|
|
|
endif()
|
|
|
|
if (PRIMITIVES_AVX2_SRCS)
|
|
|
|
set_source_files_properties(${PRIMITIVES_AVX2_SRCS} PROPERTIES COMPILE_FLAGS "-mavx2" )
|
|
|
|
endif()
|
2024-06-11 10:30:18 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
set_source_files_properties(${PRIMITIVES_OPT_SRCS} PROPERTIES COMPILE_FLAGS "/arch:SSE2")
|
|
|
|
endif()
|
|
|
|
elseif(WITH_NEON)
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCC OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
|
|
|
if (NOT MSVC_ARM64 AND NOT ARCH_ARM64)
|
|
|
|
set_source_files_properties(${PRIMITIVES_OPT_SRCS} PROPERTIES COMPILE_FLAGS "-mfpu=neon")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
# TODO: Add MSVC equivalent
|
|
|
|
endif()
|
|
|
|
|
|
|
|
freerdp_object_library_add(freerdp-primitives)
|
|
|
|
|
|
|
|
if(BUILD_TESTING AND NOT WIN32 AND NOT APPLE)
|
|
|
|
add_subdirectory(test)
|
|
|
|
endif()
|