summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/CrayPrgEnv.cmake
diff options
context:
space:
mode:
authorChuck Cranor <chuck@ece.cmu.edu>2019-01-29 15:17:44 (GMT)
committerChuck Cranor <chuck@ece.cmu.edu>2019-01-29 15:17:44 (GMT)
commiteaf53158f49e6e7581613376e8c054e18bdffc23 (patch)
tree6e72b998d818700ec2d90b4e1982047f4106b349 /Modules/Compiler/CrayPrgEnv.cmake
parentef8f237686c2a0b51249bfd46d9498abeb019e76 (diff)
downloadCMake-eaf53158f49e6e7581613376e8c054e18bdffc23.zip
CMake-eaf53158f49e6e7581613376e8c054e18bdffc23.tar.gz
CMake-eaf53158f49e6e7581613376e8c054e18bdffc23.tar.bz2
CrayPrgEnv/ParseImplicitIncludes: simplify for new implict include parser
Remove now redundant implicit parser code from CrayPrgEnv.cmake, as this function is now supported in the general cmake code (e.g. Modules/CMakeParseImplicit{Include,Link}Info.cmake). This simplifies __CrayPrgEnv_setup() to take only one arg (${lang}) and allows us to remove a level of inclusion as CrayPrgEnv-${lang}.cmake is now compiler independent we do not need the CrayPrgEnv-${compiler}-${lang} files any more.
Diffstat (limited to 'Modules/Compiler/CrayPrgEnv.cmake')
-rw-r--r--Modules/Compiler/CrayPrgEnv.cmake57
1 files changed, 1 insertions, 56 deletions
diff --git a/Modules/Compiler/CrayPrgEnv.cmake b/Modules/Compiler/CrayPrgEnv.cmake
index 05e3fc7..6c1c770 100644
--- a/Modules/Compiler/CrayPrgEnv.cmake
+++ b/Modules/Compiler/CrayPrgEnv.cmake
@@ -4,54 +4,7 @@ if(__craylinux_crayprgenv)
endif()
set(__craylinux_crayprgenv 1)
-macro(__cray_extract_args cmd tag_regex out_var make_absolute)
- string(REGEX MATCHALL "${tag_regex}" args "${cmd}")
- foreach(arg IN LISTS args)
- string(REGEX REPLACE "^${tag_regex}$" "\\2" param "${arg}")
- if(make_absolute)
- get_filename_component(param "${param}" ABSOLUTE)
- endif()
- list(APPEND ${out_var} ${param})
- endforeach()
-endmacro()
-
-function(__cray_extract_implicit src compiler_cmd link_cmd lang include_dirs_var link_dirs_var link_libs_var)
- set(BIN "${CMAKE_PLATFORM_INFO_DIR}/CrayExtractImplicit_${lang}.bin")
- execute_process(
- COMMAND ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_VERBOSE_FLAG} -o ${BIN}
- RESULT_VARIABLE result
- OUTPUT_VARIABLE output
- ERROR_VARIABLE error
- )
- if(EXISTS "${BIN}")
- file(REMOVE "${BIN}")
- endif()
- set(include_dirs)
- set(link_dirs)
- set(link_libs)
- string(REGEX REPLACE "\r?\n" ";" output_lines "${output}\n${error}")
- foreach(line IN LISTS output_lines)
- if("${line}" MATCHES "${compiler_cmd}")
- __cray_extract_args("${line}" " -(I ?|isystem )([^ ]*)" include_dirs 1)
- set(processed_include 1)
- endif()
- if("${line}" MATCHES "${link_cmd}")
- __cray_extract_args("${line}" " -(L ?)([^ ]*)" link_dirs 1)
- __cray_extract_args("${line}" " -(l ?)([^ ]*)" link_libs 0)
- set(processed_link 1)
- endif()
- if(processed_include AND processed_link)
- break()
- endif()
- endforeach()
-
- set(${include_dirs_var} "${include_dirs}" PARENT_SCOPE)
- set(${link_dirs_var} "${link_dirs}" PARENT_SCOPE)
- set(${link_libs_var} "${link_libs}" PARENT_SCOPE)
- set(CRAY_${lang}_EXTRACTED_IMPLICIT 1 CACHE INTERNAL "" FORCE)
-endfunction()
-
-macro(__CrayPrgEnv_setup lang test_src compiler_cmd link_cmd)
+macro(__CrayPrgEnv_setup lang)
if(DEFINED ENV{CRAYPE_VERSION})
message(STATUS "Cray Programming Environment $ENV{CRAYPE_VERSION} ${lang}")
elseif(DEFINED ENV{ASYNCPE_VERSION})
@@ -81,12 +34,4 @@ macro(__CrayPrgEnv_setup lang test_src compiler_cmd link_cmd)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(CMAKE_LINK_SEARCH_START_STATIC TRUE)
endif()
- if(NOT CRAY_${lang}_EXTRACTED_IMPLICIT)
- __cray_extract_implicit(
- ${test_src} ${compiler_cmd} ${link_cmd} ${lang}
- CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES
- CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES
- CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES
- )
- endif()
endmacro()