Skip to content

Commit

Permalink
21162: Removes stripping of debug symbols, adds single-threaded AFMI …
Browse files Browse the repository at this point in the history
…binary (#217)
  • Loading branch information
apbassett authored Aug 12, 2024
1 parent 6ad2c45 commit 50c700d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 9 deletions.
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
3 changes: 2 additions & 1 deletion build/cmake/create_package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
21 changes: 16 additions & 5 deletions build/cmake/custom_add_target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand All @@ -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})

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 50c700d

Please sign in to comment.