Skip to content

Commit

Permalink
Fix compilation without precompiled headers
Browse files Browse the repository at this point in the history
  • Loading branch information
magiblot committed Nov 16, 2021
1 parent c45b556 commit 6a635e3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
env:
CC: clang
CXX: clang++
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_CXX_FLAGS="-std=c++17"
run: cmake . -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DTV_OPTIMIZE_BUILD=OFF

- name: Build
shell: bash
Expand Down
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
# * TV_REDUCE_APP_SIZE (default OFF) to reduce executable size by asking the
# linker to strip out unused funcions and data. This affects the library's PUBLIC
# linker flags.
# * TV_OPTIMIZE_BUILD (default ON) to build with Precompiled Headers (CMake 3.16
# or newer.
# * TV_LIBRARY_UNITY_BUILD (default OFF) to reduce the build time of the main library
# (CMake 3.16 or newer).
# (CMake 3.16 or newer), at the cost of possibly increasing its size.
# * TV_BUILD_AVSCOLOR (default OFF) to build an AviSynth plugin for testing the
# terminal color quantization (Unix only).

Expand Down Expand Up @@ -139,6 +141,12 @@ if ((CMAKE_VERSION VERSION_LESS "3.16.0") AND TV_LIBRARY_UNITY_BUILD)
set(TV_LIBRARY_UNITY_BUILD OFF)
endif()

option(TV_OPTIMIZE_BUILD "Use CMake's Precompiled Headers" OFF)
if ((CMAKE_VERSION VERSION_LESS "3.16.0") AND TV_OPTIMIZE_BUILD)
tv_message(WARNING "'TV_OPTIMIZE_BUILD' requested but only available in CMake 3.16.0 or newer.")
set(TV_OPTIMIZE_BUILD OFF)
endif()

option(TV_BUILD_AVSCOLOR "Build AviSynth TermColor plugin" OFF)

tv_message_mp(STATUS "Install path: ${CMAKE_INSTALL_PREFIX}")
Expand Down
1 change: 1 addition & 0 deletions include/tvision/internal/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define PLATFORM_H

#define Uses_TPoint
#define Uses_TColorAttr
#include <tvision/tv.h>
#include <internal/stdioctl.h>
#include <internal/buffdisp.h>
Expand Down
3 changes: 3 additions & 0 deletions source/platform/stdioctl.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#define Uses_TPoint
#include <tvision/tv.h>

#include <internal/stdioctl.h>
#include <internal/getenv.h>

Expand Down

0 comments on commit 6a635e3

Please sign in to comment.