8000 Make TVision build on Windows XP. by guilt · Pull Request #180 · magiblot/tvision · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Make TVision build on Windows XP. #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,13 @@ if (MASTER_PROJECT)
option(TV_BUILD_EXAMPLES "Build example apps" ON)
endif()

option(TV_USE_STATIC_RTL "Link against the static version of the runtime library (MSVC only)" OFF)
option(TV_USE_STATIC_RTL "Link against the static version of the runtime library (MSVC, GCC only)" OFF)
if (MSVC)
set(MAY_USE_STATIC_RTL TRUE)
elseif (CMAKE_COMPILER_IS_GNUCC)
set(MAY_USE_STATIC_RTL TRUE)
elseif (TV_USE_STATIC_RTL)
tv_message(WARNING "'TV_USE_STATIC_RTL' requested but only available in MSVC or equivalent.")
tv_message(WARNING "'TV_USE_STATIC_RTL' requested but only available in MSVC, GCC.")
set(TV_USE_STATIC_RTL OFF)
endif()

Expand Down
20 changes: 15 additions & 5 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,29 @@ foreach (cfg ${CMAKE_CONFIGURATION_TYPES})
endforeach()

if (TV_USE_STATIC_RTL) # Implies MSVC
target_compile_options(${PROJECT_NAME} PUBLIC
/MT$<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:d>
)
if(MSVC)
target_compile_options(${PROJECT_NAME} PUBLIC
/MT$<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:d>
)
elseif (CMAKE_COMPILER_IS_GNUCC)
target_compile_options(${PROJECT_NAME} PUBLIC
-static -static-libgcc -static-libstdc++
)
target_link_options(${PROJECT_NAME} PUBLIC
-static -static-libgcc -static-libstdc++
)
endif()
endif()

if (WIN32)
# Windows XP is the minimum supported version. Default is Windows Vista.
set(TV_WIN_VER "0x600" CACHE STRING "Turbo Vision: Windows version")
target_compile_definitions(${PROJECT_NAME} PUBLIC
_CRT_NONSTDC_NO_WARNINGS
_CRT_SECURE_NO_WARNINGS
)
target_compile_definitions(${PROJECT_NAME} PRIVATE
# Windows Vista is the minimum supported version.
_WIN32_WINNT=0x0600
_WIN32_WINNT=${TV_WIN_VER}
)
endif()

Expand Down
2 changes: 2 additions & 0 deletions source/platform/win32con.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Win32ConsoleAdapter &Win32ConsoleAdapter::create() noexcept
// "A monospace bitmap font has all of these low-order bits clear".
return !(family & (TMPF_FIXED_PITCH | TMPF_VECTOR | TMPF_TRUETYPE | TMPF_DEVICE));
};
#if _WIN32_WINNT > 0x600
if ( GetCurrentConsoleFontEx(con.out(), FALSE, &fontInfo)
&& isBitmap(fontInfo.FontFamily) )
{
Expand All @@ -101,6 +102,7 @@ Win32ConsoleAdapter &Win32ConsoleAdapter::create() noexcept
break;
}
}
#endif
}
WinWidth::reset();
auto &display = *new Win32Display(con, supportsVT);
Expand Down
2 changes: 2 additions & 0 deletions source/tvision/ttimerqu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ static TTimePoint systemTimeMs()
return THardwareInfo::getTickCount()*55;
#elif defined( __BORLANDC__ )
return GetTickCount();
#elif defined(_WIN32_WINNT) && (_WIN32_WINNT < 0x600)
return GetTickCount();
#else
return GetTickCount64();
#endif
Expand Down
Loading
0