diff options
author | cianciosa <cianciosamr@ornl.gov> | 2021-08-11 12:00:07 -0400 |
---|---|---|
committer | cianciosa <cianciosamr@ornl.gov> | 2021-08-11 12:00:07 -0400 |
commit | c28560129f65c212eba0093e99f4c9163856bffa (patch) | |
tree | aad225fa61d7ddeb5c01dbea26058593f6520eef /cmake | |
parent | b9e4fb206ddb8b11576d9a2b5d8b87c15ddce196 (diff) | |
download | openblas-c28560129f65c212eba0093e99f4c9163856bffa.tar.gz openblas-c28560129f65c212eba0093e99f4c9163856bffa.tar.bz2 openblas-c28560129f65c212eba0093e99f4c9163856bffa.zip |
Check the total number of arguments passed insead of if the ARGV# is defined. This fixes a problem when compling openblas as a subproject of another code.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/utils.cmake | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/cmake/utils.cmake b/cmake/utils.cmake index 6b54092ea..09bae7011 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -157,31 +157,31 @@ endfunction () # STRING - compiles only the given type (e.g. DOUBLE) function(GenerateNamedObjects sources_in) - if (DEFINED ARGV1) + if (${ARGC} GREATER 1) set(defines_in ${ARGV1}) endif () - if (DEFINED ARGV2 AND NOT "${ARGV2}" STREQUAL "") + if (${ARGC} GREATER 2 AND NOT "${ARGV2}" STREQUAL "") set(name_in ${ARGV2}) # strip off extension for kernel files that pass in the object name. get_filename_component(name_in ${name_in} NAME_WE) endif () - if (DEFINED ARGV3) + if (${ARGC} GREATER 3) set(use_cblas ${ARGV3}) else () set(use_cblas false) endif () - if (DEFINED ARGV4) + if (${ARGC} GREATER 4) set(replace_last_with ${ARGV4}) endif () - if (DEFINED ARGV5) + if (${ARGC} GREATER 5) set(append_with ${ARGV5}) endif () - if (DEFINED ARGV6) + if ${ARGC} GREATER 6) set(no_float_type ${ARGV6}) else () set(no_float_type false) @@ -196,7 +196,7 @@ function(GenerateNamedObjects sources_in) set(real_only false) set(complex_only false) set(mangle_complex_sources false) - if (DEFINED ARGV7 AND NOT "${ARGV7}" STREQUAL "") + if (${ARGC} GREATER 7 AND NOT "${ARGV7}" STREQUAL "") if (${ARGV7} EQUAL 1) set(real_only true) elseif (${ARGV7} EQUAL 2) @@ -342,17 +342,17 @@ endfunction () function(GenerateCombinationObjects sources_in defines_in absent_codes_in all_defines_in replace_scheme) set(alternate_name_in "") - if (DEFINED ARGV5) + if (${ARGC} GREATER 5) set(alternate_name_in ${ARGV5}) endif () set(no_float_type false) - if (DEFINED ARGV6) + if (${ARGC} GREATER 6) set(no_float_type ${ARGV6}) endif () set(complex_filename_scheme "") - if (DEFINED ARGV7) + if (${ARGC} GREATER 7) set(complex_filename_scheme ${ARGV7}) endif () |