From 9d7946e13cb3c9eca660bc33eb45a89633872bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Rom=C3=A1rio=20Santana=20Rios?= Date: Thu, 17 Sep 2020 20:38:48 -0300 Subject: [PATCH] Link lib for GCC --- src/CMakeLists.txt | 7 +++++-- src/fs/CMakeLists.txt | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 400a926..2f98774 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -35,8 +35,11 @@ add_subdirectory(json) target_link_libraries(${PROJECT_NAME} application_lib) +# GCC requires explicit linking to the static lib +if(CMAKE_COMPILER_IS_GNUCXX) + target_link_libraries(${PROJECT_NAME} stdc++fs) +endif() + if(MSVC) set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/INCREMENTAL:NO") endif() - - diff --git a/src/fs/CMakeLists.txt b/src/fs/CMakeLists.txt index 7cf9a3e..e62f0a1 100644 --- a/src/fs/CMakeLists.txt +++ b/src/fs/CMakeLists.txt @@ -10,3 +10,8 @@ file(GLOB fs_sources ) add_library( ${PROJECT_NAME}_lib STATIC ${fs_sources} ) + +# GCC requires explicit linking to the static lib +if(CMAKE_COMPILER_IS_GNUCXX) + target_link_libraries(${PROJECT_NAME}_lib stdc++fs) +endif()