mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-19 20:52:26 +08:00
Use DISABLE_ACTOR_WITHOUT_WAIT_WARNING consistently
This commit is contained in:
parent
df3454114e
commit
3a38bff8ee
@ -14,7 +14,7 @@ endmacro()
|
|||||||
|
|
||||||
set(ACTOR_TARGET_COUNTER "0")
|
set(ACTOR_TARGET_COUNTER "0")
|
||||||
macro(actor_compile target srcs)
|
macro(actor_compile target srcs)
|
||||||
set(options DISABLE_ACTOR_WITHOUT_WAIT)
|
set(options DISABLE_ACTOR_WITHOUT_WAIT_WARNING)
|
||||||
set(oneValueArg)
|
set(oneValueArg)
|
||||||
set(multiValueArgs)
|
set(multiValueArgs)
|
||||||
cmake_parse_arguments(ACTOR_COMPILE "${options}" "${oneValueArgs}" "${multiValueArgs}" "${ARGN}")
|
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})
|
string(REPLACE ".actor.cpp" ".actor.g.cpp" tmp ${src})
|
||||||
endif()
|
endif()
|
||||||
set(actor_compiler_flags "")
|
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")
|
set(actor_compiler_flags "--disable-actor-without-wait-error")
|
||||||
endif()
|
endif()
|
||||||
if(tmp)
|
if(tmp)
|
||||||
|
@ -52,14 +52,14 @@ if(NOT WIN32)
|
|||||||
list(APPEND FDBRPC_SRCS libcoroutine/context.c libeio/eio.c)
|
list(APPEND FDBRPC_SRCS libcoroutine/context.c libeio/eio.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(FDBRPC_SRCS_ALLOW_ACTOR_WITHOUT_WAIT
|
set(FDBRPC_SRCS_DISABLE_ACTOR_WITHOUT_WAIT_WARNING
|
||||||
ActorFuzz.actor.cpp
|
ActorFuzz.actor.cpp
|
||||||
FlowTests.actor.cpp
|
FlowTests.actor.cpp
|
||||||
dsltest.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})
|
add_library(fdbrpc STATIC ${FDBRPC_BUILD})
|
||||||
actor_compile(fdbrpc "${FDBRPC_SRCS}")
|
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_include_directories(fdbrpc PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/libeio)
|
||||||
target_link_libraries(fdbrpc PUBLIC flow)
|
target_link_libraries(fdbrpc PUBLIC flow)
|
||||||
|
@ -38,10 +38,10 @@ namespace actorcompiler
|
|||||||
|
|
||||||
class ErrorMessagePolicy
|
class ErrorMessagePolicy
|
||||||
{
|
{
|
||||||
public bool ActorWithoutWaitEnabled = true;
|
public bool DisableActorWithoutWaitWarning = false;
|
||||||
public void HandleActorWithoutWait(String sourceFile, Actor actor)
|
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.
|
// 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);
|
Console.Error.WriteLine("{0}:{1}: warning: ACTOR {2} does not contain a wait() statement", sourceFile, actor.SourceLine, actor.name);
|
||||||
|
@ -33,7 +33,7 @@ namespace actorcompiler
|
|||||||
if (args.Length < 2)
|
if (args.Length < 2)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Usage:");
|
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;
|
return 100;
|
||||||
}
|
}
|
||||||
Console.WriteLine("actorcompiler {0}", string.Join(" ", args));
|
Console.WriteLine("actorcompiler {0}", string.Join(" ", args));
|
||||||
@ -41,7 +41,7 @@ namespace actorcompiler
|
|||||||
ErrorMessagePolicy errorMessagePolicy = new ErrorMessagePolicy();
|
ErrorMessagePolicy errorMessagePolicy = new ErrorMessagePolicy();
|
||||||
if (args.Contains("--disable-actor-without-wait-error"))
|
if (args.Contains("--disable-actor-without-wait-error"))
|
||||||
{
|
{
|
||||||
errorMessagePolicy.ActorWithoutWaitEnabled = false;
|
errorMessagePolicy.DisableActorWithoutWaitWarning = true;
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user