diff options
author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2021-05-16 21:06:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-16 21:06:48 -0400 |
commit | bc3013fc68746265db78bf92623f7e6e3e469264 (patch) | |
tree | fadf9d7fb0febde598dbc4a7b5ec27eea62020cc /CMakeLists.txt | |
parent | 25493db89f8e23d2e78e1ee16b3748173ef60188 (diff) | |
download | cleanpath-bc3013fc68746265db78bf92623f7e6e3e469264.tar.gz |
Add default path (#6)
* Add default path
* Improve support/implementation logic
* Fix braces in tests
* Enable warnings
* Emit more generalized form of windows path
* Change initialization order
* Add --default/-D to documentation
* Fix platform detection
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 604534b..823cddf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.0) project(cleanpath) include(CheckIncludeFile) +include(CheckSymbolExists) include(CTest) set(CMAKE_C_STANDARD 99) @@ -9,12 +10,20 @@ set(LIB_SOURCES lib/cleanpath.c) set(MAIN_SOURCES src/main.c) set(LIB_INCLUDES include/cleanpath/cleanpath.h) +check_symbol_exists(confstr "unistd.h" HAVE_CONFSTR) + configure_file ("${PROJECT_SOURCE_DIR}/config.h.in" "${PROJECT_BINARY_DIR}/include/config.h") include_directories(${PROJECT_BINARY_DIR}/include) include_directories(${CMAKE_SOURCE_DIR}/include) +if(MSVC) + add_compile_options(/W4) +else() + add_compile_options(-Wall -Wextra) +endif() + enable_testing() add_subdirectory(tests) |