From 708e33817d5996b10489737a71a05500b203b6dc Mon Sep 17 00:00:00 2001 From: Jessica James Date: Sat, 29 Sep 2018 12:51:38 -0500 Subject: [PATCH] Added missing CMake files, fixed a linker issue --- .gitignore | 1 - build/CMakeLists.txt | 6 ++++++ build/GNU/CMakeLists.txt | 13 +++++++++++++ src/common/CMakeLists.txt | 2 ++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 build/CMakeLists.txt create mode 100644 build/GNU/CMakeLists.txt diff --git a/.gitignore b/.gitignore index 0a1cddf..6ea5eac 100644 --- a/.gitignore +++ b/.gitignore @@ -34,7 +34,6 @@ # Build directories .idea .vs/ -build/ cmake-build-* [Dd]ebug/ diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt new file mode 100644 index 0000000..a840d28 --- /dev/null +++ b/build/CMakeLists.txt @@ -0,0 +1,6 @@ +# Include any compiler-specifc settings +if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/build/${CMAKE_CXX_COMPILER_ID}") + include("${CMAKE_CURRENT_SOURCE_DIR}/build/${CMAKE_CXX_COMPILER_ID}/CMakeLists.txt") +else() + message(STATUS "No compiler-specific settings set; CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}") +endif() diff --git a/build/GNU/CMakeLists.txt b/build/GNU/CMakeLists.txt new file mode 100644 index 0000000..e5b6b42 --- /dev/null +++ b/build/GNU/CMakeLists.txt @@ -0,0 +1,13 @@ +# GCC-specific compiler settings + +# Enable all/extra warnings +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") + +# Treat all warnings as errors +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") + +# Enable address sanitizer on debug +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") + +# Enable std::filesystem +set(JESSILIB_ADDITOINAL_LIBS "stdc++fs") diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 19b64e7..fd669b7 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -6,3 +6,5 @@ set(SOURCE_FILES timer/timer.cpp timer/timer_manager.cpp thread_pool.cpp timer/timer_context.cpp timer/cancel_token.cpp timer/synchronized_timer.cpp object.cpp parser/parser.cpp parser/parser_manager.cpp config.cpp serialize.cpp) add_library(jessilib ${SOURCE_FILES}) + +target_link_libraries(jessilib ${JESSILIB_ADDITOINAL_LIBS})