Skip to content

Commit

Permalink
Fix conflict with pkgconfig generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Pansysk75 committed Sep 11, 2024
1 parent 45a61a5 commit 2208267
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions cmake/HPX_GeneratePackageUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -242,16 +242,18 @@ function(hpx_sanitize_usage_requirements property is_build)

endfunction(hpx_sanitize_usage_requirements)

function(hpx_filter_cuda_flags cflag_list)
set(_cflag_list "${${cflag_list}}")
string(REGEX REPLACE "\\$<\\$<COMPILE_LANGUAGE:CUDA>:[^>]*>;?" "" _cflag_list
"${_cflag_list}"
)
set(${cflag_list}
${_cflag_list}
PARENT_SCOPE
)
endfunction(hpx_filter_cuda_flags)
function(hpx_filter_language_flags cflag_list)
set(_cflag_list "${${cflag_list}}")
# We are always in CXX, so replace conditional values with the values themselves
string(REGEX REPLACE "\\$<\\$<COMPILE_LANGUAGE:CXX>:([^>]*)>?" "\\1" _cflag_list "${_cflag_list}")
# Remove conditional values for other languages
string(REGEX REPLACE "\\$<\\$<COMPILE_LANGUAGE:[^>]*>:([^>]*)>?" "" _cflag_list "${_cflag_list}")

set(${cflag_list}
${_cflag_list}
PARENT_SCOPE
)
endfunction(hpx_filter_language_flags)

# Append the corresponding (-D, -I) flags for the compilation
function(
Expand Down Expand Up @@ -383,14 +385,18 @@ function(hpx_generate_pkgconfig_from_target target template is_build)
hpx_compile_definitions hpx_compile_options hpx_pic_option
hpx_include_directories hpx_system_include_directories hpx_cflags_list
)
# Cannot generate one file per language yet so filter out cuda
hpx_filter_cuda_flags(hpx_cflags_list)
# Generator expressions that depend on language must be filtered out
hpx_filter_language_flags(hpx_cflags_list)
hpx_construct_library_list(
hpx_link_libraries hpx_link_options hpx_library_list
)

string(TOLOWER ${CMAKE_BUILD_TYPE} build_type)

# Print hpx_library_list and hpx_cflags_list
message(STATUS "hpx_library_list: ${hpx_library_list}")
message(STATUS "hpx_cflags_list: ${hpx_cflags_list}")

configure_file(
cmake/templates/${template}.pc.in
${OUTPUT_DIR}${template}_${build_type}.pc.in @ONLY ESCAPE_QUOTES
Expand Down

0 comments on commit 2208267

Please sign in to comment.