summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Linux-OpenWatcom.cmake
diff options
context:
space:
mode:
authorCameron Cawley <ccawley2011@gmail.com>2022-04-17 12:12:57 (GMT)
committerBrad King <brad.king@kitware.com>2022-05-06 14:40:59 (GMT)
commit6a2b016bbd35f5843cc95e36431928fd0905a61c (patch)
treeb1d8b95203bb5729f2d8e025667d253cfe7c766a /Modules/Platform/Linux-OpenWatcom.cmake
parent33da5824acefcb4106ce89fc2278111dc3846c0a (diff)
downloadCMake-6a2b016bbd35f5843cc95e36431928fd0905a61c.zip
CMake-6a2b016bbd35f5843cc95e36431928fd0905a61c.tar.gz
CMake-6a2b016bbd35f5843cc95e36431928fd0905a61c.tar.bz2
OpenWatcom: Support CMAKE_WATCOM_RUNTIME_LIBRARY with Linux and OS/2 builds
Diffstat (limited to 'Modules/Platform/Linux-OpenWatcom.cmake')
-rw-r--r--Modules/Platform/Linux-OpenWatcom.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/Modules/Platform/Linux-OpenWatcom.cmake b/Modules/Platform/Linux-OpenWatcom.cmake
index 5b4e995..678d373 100644
--- a/Modules/Platform/Linux-OpenWatcom.cmake
+++ b/Modules/Platform/Linux-OpenWatcom.cmake
@@ -10,6 +10,14 @@ string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " system linux opt noextension")
string(APPEND CMAKE_MODULE_LINKER_FLAGS_INIT " system linux")
string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " system linux")
+cmake_policy(GET CMP0136 __LINUX_WATCOM_CMP0136)
+if(__LINUX_WATCOM_CMP0136 STREQUAL "NEW")
+ set(CMAKE_WATCOM_RUNTIME_LIBRARY_DEFAULT "SingleThreaded")
+else()
+ set(CMAKE_WATCOM_RUNTIME_LIBRARY_DEFAULT "")
+endif()
+unset(__LINUX_WATCOM_CMP0136)
+
# single/multi-threaded /-bm
# default is setup for single-threaded libraries
string(APPEND CMAKE_C_FLAGS_INIT " -bt=linux")
@@ -23,3 +31,8 @@ if(CMAKE_CROSSCOMPILING)
set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES $ENV{WATCOM}/lh)
endif()
endif()
+
+macro(__linux_open_watcom lang)
+ set(CMAKE_${lang}_COMPILE_OPTIONS_WATCOM_RUNTIME_LIBRARY_SingleThreaded "")
+ set(CMAKE_${lang}_COMPILE_OPTIONS_WATCOM_RUNTIME_LIBRARY_MultiThreaded -bm)
+endmacro()