# HG changeset patch # User Shinji KONO # Date 1482114978 -32400 # Node ID 9c85c3a347266af7e6f78ca4fa3973eb4fddbf4a # Parent 4051c012dec3ee1d800844439537700ead85fbba Cmake macro diff -r 4051c012dec3 -r 9c85c3a34726 src/parallel_execution/CMakeLists.txt --- a/src/parallel_execution/CMakeLists.txt Sun Dec 18 21:48:40 2016 +0900 +++ b/src/parallel_execution/CMakeLists.txt Mon Dec 19 11:36:18 2016 +0900 @@ -6,30 +6,22 @@ set(CMAKE_C_COMPILER $ENV{CBC_COMPILER}) -add_custom_command ( - OUTPUT c/enumCode.h - COMMAND "perl" "generate_context.pl" -) - macro( GearsCommand ) - set( _OPTIONS_ARGS ) set( _ONE_VALUE_ARGS TARGET ) set( _MULTI_VALUE_ARGS SOURCES ) - cmake_parse_arguments( _Gears "${_OPTIONS_ARGS}" "${_ONE_VALUE_ARGS}" "${_MULTI_VALUE_ARGS}" ${ARGN} ) - - # message("target = ${_Gears_TARGET}") - # message("sources = ${_Gears_SOURCES}") - - add_executable(${_Gears_TARGET} ${_Gears_SOURCES}) + add_custom_command ( + OUTPUT c/enumCode.h + COMMAND "perl" "generate_context.pl" ${_Gears_SOURCES} + ) + add_executable(${_Gears_TARGET} ${_Gears_SOURCES} context.c c/enumCode.h ) endmacro() GearsCommand( TARGET twice SOURCES - main.c - context.c rb_tree.c stack.c origin_cs.c allocate.c compare.c worker.c dependency.c time.c twice.c c/enumCode.h + main.c rb_tree.c stack.c origin_cs.c allocate.c compare.c worker.c dependency.c time.c twice.c ) diff -r 4051c012dec3 -r 9c85c3a34726 src/parallel_execution/generate_context.pl --- a/src/parallel_execution/generate_context.pl Sun Dec 18 21:48:40 2016 +0900 +++ b/src/parallel_execution/generate_context.pl Mon Dec 19 11:36:18 2016 +0900 @@ -36,7 +36,7 @@ system "rm -rf c"; system "mkdir c"; -while (<*.c>) { +while (<@ARGV>) { next if (/context.c/); &getStubInfo($_); }