From d3640dbdd576eaa9091f36f4a0b1bb981518ced9 Mon Sep 17 00:00:00 2001 From: Jiri Malak Date: Tue, 28 Apr 2020 02:30:23 -0400 Subject: OpenWatcom: Organize and update C/C++ toolchain command lines --- Modules/Compiler/OpenWatcom.cmake | 42 ++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/Modules/Compiler/OpenWatcom.cmake b/Modules/Compiler/OpenWatcom.cmake index 37cbb33..9efbfc2 100644 --- a/Modules/Compiler/OpenWatcom.cmake +++ b/Modules/Compiler/OpenWatcom.cmake @@ -24,8 +24,11 @@ foreach(type CREATE_SHARED_LIBRARY CREATE_SHARED_MODULE LINK_EXECUTABLE) endforeach() foreach(type SHARED MODULE EXE) - string(APPEND CMAKE_${type}_LINKER_FLAGS_DEBUG_INIT " debug all opt map") - string(APPEND CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO_INIT " debug all opt map") + # linker map file creation directives + string(APPEND CMAKE_${type}_LINKER_FLAGS_INIT " opt map") + # linker debug directives + string(APPEND CMAKE_${type}_LINKER_FLAGS_DEBUG_INIT " debug all") + string(APPEND CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO_INIT " debug all") endforeach() foreach(lang C CXX) @@ -46,43 +49,42 @@ 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_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name file {} ${CMAKE_END_TEMP_FILE}") - + "wlink ${CMAKE_WLINK_QUIET} name file {} ") # C++ link a object files into an executable file set(CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE}) # C compile a file into an object file set(CMAKE_C_COMPILE_OBJECT - " ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} -d+ -fo -c -cc ${CMAKE_END_TEMP_FILE}") - + " ${CMAKE_WCL_QUIET} -d+ -fo -c -cc ") # C++ compile a file into an object file set(CMAKE_CXX_COMPILE_OBJECT - " ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} -d+ -fo -c -cc++ ${CMAKE_END_TEMP_FILE}") + " ${CMAKE_WCL_QUIET} -d+ -fo -c -cc++ ") # C preprocess a source file set(CMAKE_C_CREATE_PREPROCESSED_SOURCE - " ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} -d+ -fo -pl -cc ${CMAKE_END_TEMP_FILE}") - + " ${CMAKE_WCL_QUIET} -d+ -fo -pl -cc ") # C++ preprocess a source file set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE - " ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} -d+ -fo -pl -cc++ ${CMAKE_END_TEMP_FILE}") - -set(CMAKE_CXX_CREATE_SHARED_LIBRARY - "wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name option implib= file {} ${CMAKE_END_TEMP_FILE}") -string(REPLACE " option implib=" "" - CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_LIBRARY}") + " ${CMAKE_WCL_QUIET} -d+ -fo -pl -cc++ ") # C create a shared library -set(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) +set(CMAKE_C_CREATE_SHARED_LIBRARY + "wlink ${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 ${CMAKE_CXX_CREATE_SHARED_MODULE}) +set(CMAKE_C_CREATE_SHARED_MODULE + "wlink ${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 ") # C++ create a static library -set(CMAKE_CXX_CREATE_STATIC_LIBRARY "wlib ${CMAKE_LIB_QUIET} -c -n -b ") +set(CMAKE_CXX_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY}) -# C create a static library -set(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY}) # old CMake internaly used OpenWatcom version macros # for backward compatibility -- cgit v0.12