Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit d6ba964

Browse files
Check if we need to link against stdc++fs (#840)
* https://en.cppreference.com/w/cpp/filesystem#Notes * Revert "CLI11 & GCC8 combo have special consideration #839" * This reverts commit 3a27464. * no clang check for now
1 parent 3a27464 commit d6ba964

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

CMake/config/CompilerFlagsHelpers.cmake

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,3 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" OR ${CMAKE_SYSTEM_NAME} MATCHES "D
152152
string(APPEND CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS " ${UNDEFINED_SYMBOLS_IGNORE_FLAG}")
153153
string(APPEND CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS " ${UNDEFINED_SYMBOLS_IGNORE_FLAG}")
154154
endif()
155-
156-
# ===============================================================================
157-
# See "Note: Special instructions for GCC 8" on https://github.com/CLIUtils/CLI11
158-
# ===============================================================================
159-
if(CMAKE_CXX_COMPILER_IS_GCC
160-
AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL 8
161-
AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 9)
162-
add_compile_definitions(CLI11_HAS_FILESYSTEM=0)
163-
endif()

coreneuron/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,11 @@ target_include_directories(coreneuron SYSTEM
260260
target_include_directories(coreneuron SYSTEM
261261
PRIVATE ${CORENEURON_PROJECT_SOURCE_DIR}/external/CLI11/include)
262262

263+
# See: https://en.cppreference.com/w/cpp/filesystem#Notes
264+
if(CMAKE_CXX_COMPILER_IS_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1)
265+
target_link_libraries(coreneuron stdc++fs)
266+
endif()
267+
263268
if(CORENRN_ENABLE_GPU)
264269
# nrnran123.cpp possibly-temporarily uses Boost.Pool in GPU builds if it's available.
265270
find_package(Boost QUIET)

0 commit comments

Comments
 (0)