Merge remote-tracking branch 'origin/incoming' into stable
This commit is contained in:
commit
2fbc719438
|
@ -64,12 +64,10 @@ find_package(Threads)
|
||||||
if (${IS_GNU} OR ${IS_CLANG})
|
if (${IS_GNU} OR ${IS_CLANG})
|
||||||
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
||||||
if (Threads_FOUND AND NOT MINGW)
|
if (Threads_FOUND AND NOT MINGW)
|
||||||
if (NOT ("${CMAKE_EXE_LINKER_FLAGS}" MATCHES -static))
|
include(FindOpenMP)
|
||||||
include(FindOpenMP)
|
if (OpenMP_CXX_FOUND)
|
||||||
if (OpenMP_CXX_FOUND)
|
set(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
|
||||||
set(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
|
add_definitions(-D_GLIBCXX_PARALLEL)
|
||||||
add_definitions(-D_GLIBCXX_PARALLEL)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if (NOT DEFINED EMSCRIPTEN)
|
if (NOT DEFINED EMSCRIPTEN)
|
||||||
|
|
|
@ -38,7 +38,10 @@ int main(int argc, char* argv[]) {
|
||||||
} else goto invalid_argument;
|
} else goto invalid_argument;
|
||||||
}
|
}
|
||||||
else if (currentArgument == ArgumentShort("text")) printResult = text_provided = true;
|
else if (currentArgument == ArgumentShort("text")) printResult = text_provided = true;
|
||||||
else if (text_provided || currentArgument.ends_with(".ybcon"))
|
else if (text_provided || currentArgument.ends_with(".ybcon")) {
|
||||||
|
#ifdef _OPENMP
|
||||||
|
if (not parallel) omp_set_num_threads(1);
|
||||||
|
#endif
|
||||||
Units.insert_or_assign(currentArgument, async(not parallel ? launch::deferred : launch::async, [currentArgument, &text_provided, &target, &newLines]() {
|
Units.insert_or_assign(currentArgument, async(not parallel ? launch::deferred : launch::async, [currentArgument, &text_provided, &target, &newLines]() {
|
||||||
unit_result resultingPair;
|
unit_result resultingPair;
|
||||||
try {
|
try {
|
||||||
|
@ -61,7 +64,7 @@ int main(int argc, char* argv[]) {
|
||||||
}
|
}
|
||||||
return resultingPair;
|
return resultingPair;
|
||||||
}));
|
}));
|
||||||
else {
|
} else {
|
||||||
if (argc == 2) {
|
if (argc == 2) {
|
||||||
if (currentArgument == Argument("version")) {
|
if (currentArgument == Argument("version")) {
|
||||||
cout << Yerbacon::getVersion();
|
cout << Yerbacon::getVersion();
|
||||||
|
|
Loading…
Reference in New Issue