summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorJiri Malak <malak.jiri@gmail.com>2020-05-01 05:47:37 -0400
committerJiri Malak <malak.jiri@gmail.com>2020-05-01 12:01:14 +0200
commit086c20e9a61ab55c66a305e392c4828ef4dae20c (patch)
tree882d254b34fbb51f6fa2aa4838f730783c81530f /Source
parent79b5cf8576b257ed22b1a35fa651b56f4ba70681 (diff)
downloadcmake-086c20e9a61ab55c66a305e392c4828ef4dae20c.tar.gz
OpenWatcom: Enable 16-bit targets
Up to now CMake used OpenWatcom 32-bit target tools only. This fix enable to use OpenWatcom 16-bit target tools too. If CMAKE_SYSTEM_PROCESSOR(cross-compilation) is 'I86' then OpenWatcom tools for 16-bit targets are used.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalWatcomWMakeGenerator.cxx10
-rw-r--r--Source/cmGlobalWatcomWMakeGenerator.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx
index 07e0793ab7..d6a7afa7a4 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.cxx
+++ b/Source/cmGlobalWatcomWMakeGenerator.cxx
@@ -44,6 +44,16 @@ void cmGlobalWatcomWMakeGenerator::EnableLanguage(
this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
}
+bool cmGlobalWatcomWMakeGenerator::SetSystemName(std::string const& s,
+ cmMakefile* mf)
+{
+ if (mf->GetSafeDefinition("CMAKE_SYSTEM_PROCESSOR") == "I86") {
+ mf->AddDefinition("CMAKE_GENERATOR_CC", "wcl");
+ mf->AddDefinition("CMAKE_GENERATOR_CXX", "wcl");
+ }
+ return this->cmGlobalUnixMakefileGenerator3::SetSystemName(s, mf);
+}
+
void cmGlobalWatcomWMakeGenerator::GetDocumentation(
cmDocumentationEntry& entry)
{
diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h
index c0daf8a7fe..c47127febe 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.h
+++ b/Source/cmGlobalWatcomWMakeGenerator.h
@@ -41,6 +41,9 @@ public:
/** Get the documentation entry for this generator. */
static void GetDocumentation(cmDocumentationEntry& entry);
+ /** Tell the generator about the target system. */
+ bool SetSystemName(std::string const& s, cmMakefile* mf) override;
+
/**
* Try to determine system information such as shared library
* extension, pthreads, byte order etc.