diff --git a/CMakeLists.txt b/CMakeLists.txt index 4090b196..e4472bc3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -297,12 +297,19 @@ if(IS_LINUX AND IS_AMD64) SOURCE ${COMMON_SOURCE} APP_ONLY_SOURCE ${AMALGAM_APP_ONLY_SOURCE} IDE_FOLDER "OtherBuildTargets") add_compiled_target(AUTO_NAME TYPE "sharedlib" USE_ADVANCED_ARCH_INTRINSICS USE_PGC NO_INSTALL SOURCE ${AMALGAM_LIB_ONLY_SOURCE} ${COMMON_SOURCE} IDE_FOLDER "OtherBuildTargets") + # Single-threaded AFMI targets (amalgam-st-afmi) + add_compiled_target(AUTO_NAME TYPE "objlib" USE_ADVANCED_ARCH_INTRINSICS USE_AFMI_ST + SOURCE ${COMMON_SOURCE_THREADS} IDE_FOLDER "OtherBuildTargets") + add_compiled_target(AUTO_NAME TYPE "app" USE_ADVANCED_ARCH_INTRINSICS USE_AFMI_ST + SOURCE ${COMMON_SOURCE_THREADS} APP_ONLY_SOURCE ${AMALGAM_APP_ONLY_SOURCE}) + add_compiled_target(AUTO_NAME TYPE "sharedlib" USE_ADVANCED_ARCH_INTRINSICS USE_AFMI_ST + SOURCE ${AMALGAM_LIB_ONLY_SOURCE} ${COMMON_SOURCE_THREADS} IDE_FOLDER "OtherBuildTargets") # Multi-threaded AFMI targets (amalgam-mt-afmi) - add_compiled_target(AUTO_NAME TYPE "objlib" USE_ADVANCED_ARCH_INTRINSICS USE_AFMI + add_compiled_target(AUTO_NAME TYPE "objlib" USE_ADVANCED_ARCH_INTRINSICS USE_AFMI_MT SOURCE ${COMMON_SOURCE_THREADS} IDE_FOLDER "OtherBuildTargets") - add_compiled_target(AUTO_NAME TYPE "app" USE_ADVANCED_ARCH_INTRINSICS USE_AFMI + add_compiled_target(AUTO_NAME TYPE "app" USE_ADVANCED_ARCH_INTRINSICS USE_AFMI_MT SOURCE ${COMMON_SOURCE_THREADS} APP_ONLY_SOURCE ${AMALGAM_APP_ONLY_SOURCE}) - add_compiled_target(AUTO_NAME TYPE "sharedlib" USE_ADVANCED_ARCH_INTRINSICS USE_AFMI + add_compiled_target(AUTO_NAME TYPE "sharedlib" USE_ADVANCED_ARCH_INTRINSICS USE_AFMI_MT SOURCE ${AMALGAM_LIB_ONLY_SOURCE} ${COMMON_SOURCE_THREADS} IDE_FOLDER "OtherBuildTargets") endif() diff --git a/build/cmake/create_package.cmake b/build/cmake/create_package.cmake index ea09009c..00b97f9f 100644 --- a/build/cmake/create_package.cmake +++ b/build/cmake/create_package.cmake @@ -12,7 +12,8 @@ else() endif() set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_INSTALL_PREFIX}/../../package") set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY False) -set(CPACK_STRIP_FILES True) +# Release builds are never compiled with -g, so no need to strip files during packaging +set(CPACK_STRIP_FILES False) set(CPACK_THREADS 0) set(CPACK_ARCHIVE_THREADS 0) include(CPack) diff --git a/build/cmake/custom_add_target.cmake b/build/cmake/custom_add_target.cmake index c13ee2f9..04f1fe06 100644 --- a/build/cmake/custom_add_target.cmake +++ b/build/cmake/custom_add_target.cmake @@ -10,7 +10,7 @@ set(ALL_OBJLIB_TARGETS) set(ALL_SHAREDLIB_TARGETS) set(ALL_APP_TARGETS) function(add_compiled_target) - set(options AUTO_NAME USE_THREADS USE_OPENMP USE_PGC USE_AFMI USE_ADVANCED_ARCH_INTRINSICS NO_INSTALL) + set(options AUTO_NAME USE_THREADS USE_OPENMP USE_PGC USE_AFMI_MT USE_AFMI_ST USE_ADVANCED_ARCH_INTRINSICS NO_INSTALL) set(oneValueArgs NAME TYPE OUTPUT_NAME_BASE IDE_FOLDER) set(multiValueArgs INCLUDE_DIRS COMPILER_DEFINES LINK_LIBRARIES SOURCE APP_ONLY_SOURCE) cmake_parse_arguments(args "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -27,7 +27,8 @@ function(add_compiled_target) set(USE_THREADS ${args_USE_THREADS}) set(USE_OPENMP ${args_USE_OPENMP}) set(USE_PGC ${args_USE_PGC}) - set(USE_AFMI ${args_USE_AFMI}) + set(USE_AFMI_MT ${args_USE_AFMI_MT}) + set(USE_AFMI_ST ${args_USE_AFMI_ST}) set(USE_ADVANCED_ARCH_INTRINSICS ${args_USE_ADVANCED_ARCH_INTRINSICS}) set(NO_INSTALL ${args_NO_INSTALL}) @@ -87,8 +88,10 @@ function(add_compiled_target) string(APPEND TARGET_NAME_BASE "-omp") elseif(USE_PGC) string(APPEND TARGET_NAME_BASE "-st-pgc") - elseif(USE_AFMI) + elseif(USE_AFMI_MT) string(APPEND TARGET_NAME_BASE "-mt-afmi") + elseif(USE_AFMI_ST) + string(APPEND TARGET_NAME_BASE "-st-afmi") else() string(APPEND TARGET_NAME_BASE "-st") endif() @@ -231,10 +234,18 @@ function(add_compiled_target) target_compile_definitions(${TARGET_NAME} PUBLIC PEDANTIC_GARBAGE_COLLECTION AMALGAM_MEMORY_INTEGRITY) endif() - # AMALGAM_FAST_MEMORY_INTEGRITY: - if(USE_AFMI) + # AMALGAM_FAST_MEMORY_INTEGRITY (MT): + if(USE_AFMI_MT) target_compile_definitions(${TARGET_NAME} PUBLIC AMALGAM_FAST_MEMORY_INTEGRITY MULTITHREAD_SUPPORT) target_compile_options(${TARGET_NAME} PUBLIC -g) + target_compile_options(${TARGET_NAME} PUBLIC -O1) + endif() + + # AMALGAM_FAST_MEMORY_INTEGRITY (ST): + if(USE_AFMI_ST) + target_compile_definitions(${TARGET_NAME} PUBLIC AMALGAM_FAST_MEMORY_INTEGRITY) + target_compile_options(${TARGET_NAME} PUBLIC -g) + target_compile_options(${TARGET_NAME} PUBLIC -O1) endif() # Advanced arch intrinsics: