diff --git a/.gitignore b/.gitignore index 825e592..b8cca89 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ +.vimspector.json +.vscode build -build_test build_mingw -.vscode -.vimspector.json +build_test +venv diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt index 2d6a140..75323a2 100644 --- a/demo/CMakeLists.txt +++ b/demo/CMakeLists.txt @@ -13,14 +13,14 @@ if(${MSVC}) /DDEBUG ) else() - set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_CXX_FLAGS -static - -std=c++17 + -std=c++11 -lstdc++ -lstdc++fs -lgcc @@ -45,12 +45,14 @@ else() -DWINVER=0x0A00 -D_WIN32_WINNT=0x0A00 --coverage + -m64 + -O0 + -g3 + -DDEBUG ) list(REMOVE_DUPLICATES CMAKE_CXX_FLAGS) string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g3 -DDEBUG") set(CMAKE_SH "CMAKE_SH-NOTFOUND") endif() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 12e69fa..bdc196e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -12,16 +12,60 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(ROOT_DIR ${PROJECT_SOURCE_DIR}/..) -add_compile_options( - /W4 - /std:c11 - /D_UNICODE - /DUNICODE - /DEBUG - /DDEBUG - /utf-8 -) -add_link_options(/FORCE:MULTIPLE) +if(${MSVC}) + add_compile_options( + /W4 + /std:c11 + /D_UNICODE + /DUNICODE + /DEBUG + /DDEBUG + /utf-8 + ) + add_link_options(/FORCE:MULTIPLE) +else() + set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + + set(CMAKE_CXX_FLAGS + -static + -std=c++11 + -lstdc++ + -lstdc++fs + -lgcc + -Wall + -Wextra + -Wcast-align + -Wno-unknown-pragmas + -Wcast-qual + -Wctor-dtor-privacy + -Wdelete-non-virtual-dtor + -Wdouble-promotion + -Weffc++ + -Wold-style-cast + -Woverloaded-virtual + -Wreorder + -Wshadow + -Wsuggest-override + -Wuseless-cast + -fdiagnostics-color + -DUNICODE + -D_UNICODE + -DWINVER=0x0A00 + -D_WIN32_WINNT=0x0A00 + --coverage + -m64 + -O0 + -g3 + -DDEBUG + ) + list(REMOVE_DUPLICATES CMAKE_CXX_FLAGS) + string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + + set(CMAKE_SH "CMAKE_SH-NOTFOUND") +endif() include(ProcessorCount) ProcessorCount(PROC_N)