2016-09-27 22:01:08 +03:00
|
|
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
2016-07-06 16:53:18 +03:00
|
|
|
|
|
|
|
|
|
|
|
# This module is shared by multiple languages; use include blocker.
|
|
|
|
if(__WINDOWS_OPENWATCOM)
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
set(__WINDOWS_OPENWATCOM 1)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_LIBRARY_PATH_FLAG "libpath ")
|
|
|
|
set(CMAKE_LINK_LIBRARY_FLAG "library ")
|
|
|
|
set(CMAKE_LINK_LIBRARY_FILE_FLAG "library")
|
|
|
|
|
|
|
|
if(CMAKE_VERBOSE_MAKEFILE)
|
|
|
|
set(CMAKE_WCL_QUIET)
|
|
|
|
set(CMAKE_WLINK_QUIET)
|
|
|
|
set(CMAKE_LIB_QUIET)
|
2012-08-13 21:50:14 +04:00
|
|
|
else()
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_WCL_QUIET "-zq")
|
|
|
|
set(CMAKE_WLINK_QUIET "option quiet")
|
|
|
|
set(CMAKE_LIB_QUIET "-q")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2006-01-17 18:21:45 +03:00
|
|
|
|
2016-07-13 22:06:23 +03:00
|
|
|
string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ")
|
2010-09-02 22:35:17 +04:00
|
|
|
set(CMAKE_CREATE_WIN32_EXE "system nt_win" )
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_CREATE_CONSOLE_EXE "system nt" )
|
2016-07-13 22:06:23 +03:00
|
|
|
string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " system nt_dll")
|
|
|
|
string(APPEND CMAKE_MODULE_LINKER_FLAGS_INIT " system nt_dll")
|
2014-04-01 23:20:41 +04:00
|
|
|
foreach(type SHARED MODULE EXE)
|
2016-07-13 22:06:23 +03:00
|
|
|
string(APPEND CMAKE_${type}_LINKER_FLAGS_DEBUG_INIT " debug all opt map")
|
|
|
|
string(APPEND CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO_INIT " debug all opt map")
|
2014-04-01 23:20:41 +04:00
|
|
|
endforeach()
|
2010-09-02 22:35:17 +04:00
|
|
|
|
2012-05-30 12:52:35 +04:00
|
|
|
set(CMAKE_C_COMPILE_OPTIONS_DLL "-bd") # Note: This variable is a ';' separated list
|
|
|
|
set(CMAKE_SHARED_LIBRARY_C_FLAGS "-bd") # ... while this is a space separated string.
|
2010-09-02 22:35:17 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_RC_COMPILER "rc" )
|
|
|
|
|
|
|
|
set(CMAKE_BUILD_TYPE_INIT Debug)
|
2014-04-01 23:20:41 +04:00
|
|
|
|
|
|
|
# single/multi-threaded /-bm
|
|
|
|
# static/DLL run-time libraries /-br
|
|
|
|
# default is setup for multi-threaded + DLL run-time libraries
|
2016-07-05 20:35:13 +03:00
|
|
|
string(APPEND CMAKE_C_FLAGS_INIT " -bt=nt -w3 -dWIN32 -br -bm")
|
|
|
|
string(APPEND CMAKE_CXX_FLAGS_INIT " -bt=nt -xs -w3 -dWIN32 -br -bm")
|
2014-04-01 23:20:41 +04:00
|
|
|
foreach(lang C CXX)
|
2016-07-05 20:35:13 +03:00
|
|
|
string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -d2")
|
|
|
|
string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -s -os -d0 -dNDEBUG")
|
|
|
|
string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -s -ot -d0 -dNDEBUG")
|
|
|
|
string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -s -ot -d1 -dNDEBUG")
|
2014-04-01 23:20:41 +04:00
|
|
|
endforeach()
|
2012-08-13 21:47:32 +04:00
|
|
|
|
2014-03-25 10:17:45 +04:00
|
|
|
foreach(type CREATE_SHARED_LIBRARY CREATE_SHARED_MODULE LINK_EXECUTABLE)
|
|
|
|
set(CMAKE_C_${type}_USE_WATCOM_QUOTE 1)
|
|
|
|
set(CMAKE_CXX_${type}_USE_WATCOM_QUOTE 1)
|
|
|
|
endforeach()
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_C_CREATE_IMPORT_LIBRARY
|
2014-02-28 21:21:52 +04:00
|
|
|
"wlib -c -q -n -b <TARGET_IMPLIB> +<TARGET_QUOTED>")
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_CXX_CREATE_IMPORT_LIBRARY ${CMAKE_C_CREATE_IMPORT_LIBRARY})
|
2007-03-22 16:45:25 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_C_LINK_EXECUTABLE
|
2014-04-05 01:06:13 +04:00
|
|
|
"wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name <TARGET> <LINK_FLAGS> file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
|
2006-01-17 18:21:45 +03:00
|
|
|
|
2010-09-02 22:35:17 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE})
|
2006-01-17 18:21:45 +03:00
|
|
|
|
|
|
|
# compile a C++ file into an object file
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_CXX_COMPILE_OBJECT
|
2015-07-13 17:35:04 +03:00
|
|
|
"<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} -d+ <DEFINES> <INCLUDES> <FLAGS> -fo<OBJECT> -c -cc++ <SOURCE>${CMAKE_END_TEMP_FILE}")
|
2006-01-17 18:21:45 +03:00
|
|
|
|
|
|
|
# compile a C file into an object file
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_C_COMPILE_OBJECT
|
2015-07-13 17:35:04 +03:00
|
|
|
"<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} -d+ <DEFINES> <INCLUDES> <FLAGS> -fo<OBJECT> -c -cc <SOURCE>${CMAKE_END_TEMP_FILE}")
|
2006-01-17 18:21:45 +03:00
|
|
|
|
2007-05-16 21:26:47 +04:00
|
|
|
# preprocess a C source file
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_C_CREATE_PREPROCESSED_SOURCE
|
2015-07-13 17:35:04 +03:00
|
|
|
"<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} -d+ <DEFINES> <INCLUDES> <FLAGS> -fo<PREPROCESSED_SOURCE> -pl -cc <SOURCE>${CMAKE_END_TEMP_FILE}")
|
2007-05-16 21:26:47 +04:00
|
|
|
|
|
|
|
# preprocess a C++ source file
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE
|
2015-07-13 17:35:04 +03:00
|
|
|
"<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} -d+ <DEFINES> <INCLUDES> <FLAGS> -fo<PREPROCESSED_SOURCE> -pl -cc++ <SOURCE>${CMAKE_END_TEMP_FILE}")
|
2007-05-16 21:26:47 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_CXX_CREATE_SHARED_LIBRARY
|
2014-04-05 01:06:13 +04:00
|
|
|
"wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name <TARGET> <LINK_FLAGS> option implib=<TARGET_IMPLIB> file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
|
2014-02-28 01:22:28 +04:00
|
|
|
string(REPLACE " option implib=<TARGET_IMPLIB>" ""
|
|
|
|
CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
|
2006-01-17 18:21:45 +03:00
|
|
|
|
|
|
|
# create a C shared library
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
|
2006-01-17 18:21:45 +03:00
|
|
|
|
2007-03-10 15:49:47 +03:00
|
|
|
# create a C shared module
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_MODULE})
|
2006-01-17 18:21:45 +03:00
|
|
|
|
|
|
|
# create a C++ static library
|
2014-02-28 21:21:52 +04:00
|
|
|
set(CMAKE_CXX_CREATE_STATIC_LIBRARY "wlib ${CMAKE_LIB_QUIET} -c -n -b <TARGET_QUOTED> <LINK_FLAGS> <OBJECTS> ")
|
2006-01-17 18:21:45 +03:00
|
|
|
|
|
|
|
# create a C static library
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
|
2011-07-29 21:28:54 +04:00
|
|
|
|
2012-08-13 16:15:42 +04:00
|
|
|
if(NOT _CMAKE_WATCOM_VERSION)
|
|
|
|
set(_CMAKE_WATCOM_VERSION 1)
|
|
|
|
if(CMAKE_C_COMPILER_VERSION)
|
|
|
|
set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
|
2014-04-01 23:20:41 +04:00
|
|
|
set(_compiler_id ${CMAKE_C_COMPILER_ID})
|
2012-08-13 16:15:42 +04:00
|
|
|
else()
|
|
|
|
set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
|
2014-04-01 23:20:41 +04:00
|
|
|
set(_compiler_id ${CMAKE_CXX_COMPILER_ID})
|
2012-08-13 16:15:42 +04:00
|
|
|
endif()
|
|
|
|
set(WATCOM16)
|
|
|
|
set(WATCOM17)
|
|
|
|
set(WATCOM18)
|
|
|
|
set(WATCOM19)
|
2014-03-17 22:41:02 +04:00
|
|
|
if("${_compiler_id}" STREQUAL "OpenWatcom")
|
|
|
|
if("${_compiler_version}" VERSION_LESS 1.7)
|
|
|
|
set(WATCOM16 1)
|
|
|
|
endif()
|
|
|
|
if("${_compiler_version}" VERSION_EQUAL 1.7)
|
|
|
|
set(WATCOM17 1)
|
|
|
|
endif()
|
|
|
|
if("${_compiler_version}" VERSION_EQUAL 1.8)
|
|
|
|
set(WATCOM18 1)
|
|
|
|
endif()
|
|
|
|
if("${_compiler_version}" VERSION_EQUAL 1.9)
|
|
|
|
set(WATCOM19 1)
|
|
|
|
endif()
|
2012-08-13 16:15:42 +04:00
|
|
|
endif()
|
|
|
|
endif()
|