Skip to content

Commit

Permalink
fix cmake error
Browse files Browse the repository at this point in the history
  • Loading branch information
yyzybb537 committed Jan 26, 2016
1 parent 40b6b5e commit 0b84d51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ aux_source_directory(${PROJECT_SOURCE_DIR} SRC_LIST)

list(REMOVE_ITEM SRC_LIST ${PROJECT_SOURCE_DIR}/sample2_yield.cpp)
add_executable(sample2_yield.t sample2_yield.cpp)
if (${depend_libgo})
if (depend_libgo)
add_dependencies(sample2_yield.t ${depend_libgo})
endif()

Expand All @@ -44,7 +44,7 @@ else()
target_link_libraries(sample2_yield.t ${LINK_ARGS} rt)

add_executable(sample9_curl.t sample9_curl.cpp)
if (${depend_libgo})
if (depend_libgo)
add_dependencies(sample9_curl.t ${depend_libgo})
endif()
target_link_libraries(sample9_curl.t ${LINK_ARGS} rt -lcurl)
Expand All @@ -56,7 +56,7 @@ foreach(var ${SRC_LIST})

set(target ${tgt}.t)
add_executable(${target} ${var})
if (${depend_libgo})
if (depend_libgo)
add_dependencies(${target} ${depend_libgo})
endif()
if (WIN32)
Expand Down
7 changes: 4 additions & 3 deletions samples/sample8_multithread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ using namespace std;
using namespace std::chrono;

// 大计算量的函数
int foo()
int c = 0;
void foo()
{
int v = 1;
for (int i = 1; i < 20000000; ++i)
v *= i;
return v;
c += v;
}

int main()
Expand Down Expand Up @@ -46,7 +47,7 @@ int main()
end = system_clock::now();
cout << "go with coroutine, cost ";
cout << duration_cast<milliseconds>(end - start).count() << "ms" << endl;

cout << "result zero:" << c * 0 << endl;
return 0;
}

0 comments on commit 0b84d51

Please sign in to comment.