CMAKE: allow to disable unity builds

master
Martin Gerhardy 2019-02-10 18:26:53 +01:00
parent 38c4d6b920
commit b87ef7cdac
2 changed files with 3 additions and 2 deletions

View File

@ -51,6 +51,7 @@ option(UNITTESTS_SANITIZER_THREADS "Builds tests with thread sanitizer" OFF)
option(UNITTESTS_SANITIZER_UNDEFINED "Builds tests with undefined behaviour sanitizer" OFF)
option(UNITTESTS_SANITIZER_LEAK "Builds tests with leak sanitizer" OFF)
option(UNITTESTS_SANITIZER_ADDRESS "Builds tests with address sanitizer" OFF)
option(DISABLE_UNITY "Disable the fast unity build" OFF)
option(TOOLS "Builds with tools" ON)
option(RCON "Builds with rcon tool - also needs TOOLS to be active" ON)
option(SERVER "Builds with server" ON)

View File

@ -19,8 +19,8 @@ macro(generate_unity_sources)
set(UNITY_SRC ${_UNITY_UNITY_SRC})
set(SRCS ${_UNITY_SRCS})
get_property(NOUNITY GLOBAL PROPERTY ${TARGET}_NOUNITY)
if (NOUNITY OR CMAKE_CROSSCOMPILING)
get_property(TARGET_NOUNITY GLOBAL PROPERTY ${TARGET}_NOUNITY)
if (TARGET_NOUNITY OR CMAKE_CROSSCOMPILING OR DISABLE_UNITY)
if (_UNITY_SOURCES)
target_sources(${TARGET} PRIVATE ${SRCS})
elseif (_UNITY_EXECUTABLE)