diff --git a/.cmake/ConfigureCompilerFlags.cmake b/.cmake/ConfigureCompilerFlags.cmake index bdf79f36b..c558c9336 100644 --- a/.cmake/ConfigureCompilerFlags.cmake +++ b/.cmake/ConfigureCompilerFlags.cmake @@ -1,8 +1,8 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wno-unused-result -Wno-deprecated-declarations") -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -g -frtti -fexceptions") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++17 -DDEBUG -g -frtti -fexceptions") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG") # enable for additional memory checking with fsanitize # set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3 -fsanitize=address,undefined") -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -frtti -fexceptions -Wno-psabi") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++17 -O2 -frtti -fexceptions -Wno-psabi") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -Wno-psabi") diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f09cd125..931501a41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,6 +88,11 @@ if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB) endif() endif() +if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) + message(STATUS "[build] detected old gcc, manually adding -lstdc++fs") + set (musikcube_LINK_LIBS ${musikcube_LINK_LIBS} stdc++fs) +endif() + message(STATUS "[build] musikcube_LINK_LIBS: " ${musikcube_LINK_LIBS}) add_subdirectory(src/musikcore)