summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2015-07-05 08:56:38 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2015-07-05 08:56:38 +0000
commit3eb06667bd7515a511fba36556fb0f6de8a9968b (patch)
treedbe14985cb1a0841c11e379b9a1d5f323af6dfa0 /llvm/cmake/modules
parent86042f1d2eff3ad1e4dce11757eaff052e02f905 (diff)
downloadbcm5719-llvm-3eb06667bd7515a511fba36556fb0f6de8a9968b.tar.gz
bcm5719-llvm-3eb06667bd7515a511fba36556fb0f6de8a9968b.zip
[CMake] add_llvm_symbol_exports: Use Python oneliner instead of "cmd.exe /c type" to generate *.def.
llvm-svn: 241402
Diffstat (limited to 'llvm/cmake/modules')
-rw-r--r--llvm/cmake/modules/AddLLVM.cmake15
1 files changed, 2 insertions, 13 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 4f60d9e6e7d..752d496f74f 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -93,20 +93,9 @@ function(add_llvm_symbol_exports target_name export_file)
else()
set(native_export_file "${target_name}.def")
- set(CAT "cat")
- set(export_file_nativeslashes ${export_file})
- if(WIN32 AND NOT CYGWIN AND NOT MSYS)
- set(CAT "type")
- # Convert ${export_file} to native format (backslashes) for "type"
- # Does not use file(TO_NATIVE_PATH) as it doesn't create a native
- # path but a build-system specific format (see CMake bug
- # http://public.kitware.com/Bug/print_bug_page.php?bug_id=5939 )
- string(REPLACE / \\ export_file_nativeslashes ${export_file})
- endif()
-
add_custom_command(OUTPUT ${native_export_file}
- COMMAND ${CMAKE_COMMAND} -E echo "EXPORTS" > ${native_export_file}
- COMMAND ${CAT} ${export_file_nativeslashes} >> ${native_export_file}
+ COMMAND ${PYTHON_EXECUTABLE} -c "import sys;print(''.join(['EXPORTS\\n']+sys.stdin.readlines(),))"
+ < ${export_file} > ${native_export_file}
DEPENDS ${export_file}
VERBATIM
COMMENT "Creating export file for ${target_name}")
OpenPOWER on IntegriCloud