Use DISABLE_ACTOR_WITHOUT_WAIT_WARNING consistently

This commit is contained in:
Andrew Noyes 2019-02-13 10:30:35 -08:00
parent df3454114e
commit 3a38bff8ee
4 changed files with 9 additions and 9 deletions

View File

@ -14,7 +14,7 @@ endmacro()
set(ACTOR_TARGET_COUNTER "0")
macro(actor_compile target srcs)
set(options DISABLE_ACTOR_WITHOUT_WAIT)
set(options DISABLE_ACTOR_WITHOUT_WAIT_WARNING)
set(oneValueArg)
set(multiValueArgs)
cmake_parse_arguments(ACTOR_COMPILE "${options}" "${oneValueArgs}" "${multiValueArgs}" "${ARGN}")
@ -27,7 +27,7 @@ macro(actor_compile target srcs)
string(REPLACE ".actor.cpp" ".actor.g.cpp" tmp ${src})
endif()
set(actor_compiler_flags "")
if(ACTOR_COMPILE_DISABLE_ACTOR_WITHOUT_WAIT)
if(ACTOR_COMPILE_DISABLE_ACTOR_WITHOUT_WAIT_WARNING)
set(actor_compiler_flags "--disable-actor-without-wait-error")
endif()
if(tmp)

View File

@ -52,14 +52,14 @@ if(NOT WIN32)
list(APPEND FDBRPC_SRCS libcoroutine/context.c libeio/eio.c)
endif()
set(FDBRPC_SRCS_ALLOW_ACTOR_WITHOUT_WAIT
set(FDBRPC_SRCS_DISABLE_ACTOR_WITHOUT_WAIT_WARNING
ActorFuzz.actor.cpp
FlowTests.actor.cpp
dsltest.actor.cpp)
actor_set(FDBRPC_BUILD "${FDBRPC_SRCS};${FDBRPC_SRCS_ALLOW_ACTOR_WITHOUT_WAIT}")
actor_set(FDBRPC_BUILD "${FDBRPC_SRCS};${FDBRPC_SRCS_DISABLE_ACTOR_WITHOUT_WAIT_WARNING}")
add_library(fdbrpc STATIC ${FDBRPC_BUILD})
actor_compile(fdbrpc "${FDBRPC_SRCS}")
actor_compile(fdbrpc "${FDBRPC_SRCS_ALLOW_ACTOR_WITHOUT_WAIT}" DISABLE_ACTOR_WITHOUT_WAIT)
actor_compile(fdbrpc "${FDBRPC_SRCS_DISABLE_ACTOR_WITHOUT_WAIT_WARNING}" DISABLE_ACTOR_WITHOUT_WAIT_WARNING)
target_include_directories(fdbrpc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/libeio)
target_link_libraries(fdbrpc PUBLIC flow)

View File

@ -38,10 +38,10 @@ namespace actorcompiler
class ErrorMessagePolicy
{
public bool ActorWithoutWaitEnabled = true;
public bool DisableActorWithoutWaitWarning = false;
public void HandleActorWithoutWait(String sourceFile, Actor actor)
{
if (ActorWithoutWaitEnabled && !actor.isTestCase)
if (!DisableActorWithoutWaitWarning && !actor.isTestCase)
{
// TODO(atn34): Once cmake is the only build system we can make this an error instead of a warning.
Console.Error.WriteLine("{0}:{1}: warning: ACTOR {2} does not contain a wait() statement", sourceFile, actor.SourceLine, actor.name);

View File

@ -33,7 +33,7 @@ namespace actorcompiler
if (args.Length < 2)
{
Console.WriteLine("Usage:");
Console.WriteLine(" actorcompiler <input> <output> [--disable-actor-without-wait-error]");
Console.WriteLine(" actorcompiler <input> <output> [--disable-actor-without-wait-warning]");
return 100;
}
Console.WriteLine("actorcompiler {0}", string.Join(" ", args));
@ -41,7 +41,7 @@ namespace actorcompiler
ErrorMessagePolicy errorMessagePolicy = new ErrorMessagePolicy();
if (args.Contains("--disable-actor-without-wait-error"))
{
errorMessagePolicy.ActorWithoutWaitEnabled = false;
errorMessagePolicy.DisableActorWithoutWaitWarning = true;
}
try
{