Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bsd fixes #347

Merged
merged 3 commits into from
May 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 14 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,24 @@ set(ANALYZE CACHE BOOL "Run static analysis on the code, requires cppcheck and c

# Compiler flags
set(WARNINGS "-Wall -Wextra -Wuninitialized ")
set(WARNINGS "${WARNINGS} -Wshadow -Wunsafe-loop-optimizations -Wpedantic -Wcast-align -Wwrite-strings")
set(WARNINGS "${WARNINGS} -Wshadow -Wpedantic -Wcast-align -Wwrite-strings")
set(WARNINGS "${WARNINGS} -Wmissing-declarations -Wvla")

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(WARNINGS "${WARNINGS} -Wunsafe-loop-optimizations")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(WARNINGS "${WARNINGS} -Wno-gnu-zero-variadic-macro-arguments")
endif()

set(CMAKE_CXX_FLAGS "-g ${WARNINGS} --std=c++11 -mtune=native -ffast-math")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")

# clang doesn't properly use the attributes and so requires avx to build
# should get fixed in #475
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx")
endif()

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif(NOT CMAKE_BUILD_TYPE)
Expand Down
2 changes: 1 addition & 1 deletion src/examples/usbcsv/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ int main(int argc, char* argv[])
if(!scope->LoadCSV(fname))
{
LogError("Failed to load CSV %s\n", fname.c_str());
return false;
return 0;
}

//Set up the decodes
Expand Down
6 changes: 6 additions & 0 deletions src/glscopeclient/FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ vector<string> Glob(const string& pathPattern, bool onlyDirectories)
}
#else
glob_t globResult{ };

// GLOB_ONLYDIR is only a performance flag, it doesn't promise only dirs
#ifdef GLOB_ONLYDIR
glob(pathPattern.c_str(), onlyDirectories ? GLOB_ONLYDIR : 0, NULL, &globResult);
#else
glob(pathPattern.c_str(), 0, NULL, &globResult);
#endif

if(globResult.gl_pathc > 0)
{
Expand Down