From 995f5b4e7b81e6672eaafba2c6d9a145e3aefe5d Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 27 May 2021 09:29:35 -0400 Subject: BinUtils: Find linker and librarian for OpenWatcom Update our OpenWatcom linker and archiver rules to use the `` and `` placeholders instead of hard-coding the tool names. --- Modules/CMakeFindBinUtils.cmake | 5 +++++ Modules/Compiler/OpenWatcom.cmake | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake index bfa9491..de516fc 100644 --- a/Modules/CMakeFindBinUtils.cmake +++ b/Modules/CMakeFindBinUtils.cmake @@ -86,6 +86,11 @@ if(("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_SIMULATE_ID}" STREQUAL "xMSVC" AND list(APPEND _CMAKE_TOOL_VARS LINKER MT AR) +elseif("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" MATCHES "^x(Open)?Watcom$") + set(_CMAKE_LINKER_NAMES "wlink") + set(_CMAKE_AR_NAMES "wlib") + list(APPEND _CMAKE_TOOL_VARS LINKER AR) + # in all other cases search for ar, ranlib, etc. else() if(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN) diff --git a/Modules/Compiler/OpenWatcom.cmake b/Modules/Compiler/OpenWatcom.cmake index a962513..ec36908 100644 --- a/Modules/Compiler/OpenWatcom.cmake +++ b/Modules/Compiler/OpenWatcom.cmake @@ -43,13 +43,13 @@ endforeach() # C create import library set(CMAKE_C_CREATE_IMPORT_LIBRARY - "wlib -c -q -n -b +") + " -c -q -n -b +") # C++ create import library set(CMAKE_CXX_CREATE_IMPORT_LIBRARY ${CMAKE_C_CREATE_IMPORT_LIBRARY}) # C link a object files into an executable file set(CMAKE_C_LINK_EXECUTABLE - "wlink ${CMAKE_WLINK_QUIET} name file {} ") + " ${CMAKE_WLINK_QUIET} name file {} ") # C++ link a object files into an executable file set(CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE}) @@ -69,19 +69,19 @@ set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE # C create a shared library set(CMAKE_C_CREATE_SHARED_LIBRARY - "wlink ${CMAKE_WLINK_QUIET} name option implib= file {} ") + " ${CMAKE_WLINK_QUIET} name option implib= file {} ") # C++ create a shared library set(CMAKE_CXX_CREATE_SHARED_LIBRARY ${CMAKE_C_CREATE_SHARED_LIBRARY}) # C create a shared module set(CMAKE_C_CREATE_SHARED_MODULE - "wlink ${CMAKE_WLINK_QUIET} name file {} ") + " ${CMAKE_WLINK_QUIET} name file {} ") # C++ create a shared module set(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_MODULE}) # C create a static library set(CMAKE_C_CREATE_STATIC_LIBRARY - "wlib ${CMAKE_LIB_QUIET} -c -n -b ") + " ${CMAKE_LIB_QUIET} -c -n -b ") # C++ create a static library set(CMAKE_CXX_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY}) -- cgit v0.12