Skip to content

Commit

Permalink
Add -Wall -Wextra -pedantic as compiler flags (#44)
Browse files Browse the repository at this point in the history
Co-authored-by: Even Rouault <even.rouault@spatialys.com>
  • Loading branch information
r-barnes and rouault authored Jun 22, 2023
1 parent f557104 commit 0d1d39a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ add_library(${PACKAGE} ${lib_SRC})
target_include_directories (${PACKAGE} INTERFACE
$<INSTALL_INTERFACE:include>)

if (NOT MSVC)
target_compile_options(${PACKAGE} PRIVATE -Wall -Wextra -pedantic)
endif()

if(WIN32 AND NOT CYGWIN)
set_target_properties(${PACKAGE}
PROPERTIES
Expand Down Expand Up @@ -217,6 +221,9 @@ foreach(executable ${executables})
if(BUILD_TESTING)
get_target_property(${executable}_LOC ${executable} LOCATION)
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/script.sed "s?\\./${executable}?${${executable}_LOC}?\n")
endif(BUILD_TEST)

This comment has been minimized.

Copy link
@jmckenna

jmckenna Jun 27, 2023

Contributor

this change causes several CMake warnings of:

CMake Warning (dev) in CMakeLists.txt:
  A logical block opening on the line
    CMakeLists.txt:221 (if)
  closes on the line
    CMakeLists.txt:224 (endif)
  with mis-matching arguments.
if (NOT MSVC)
target_compile_options(${executable} PRIVATE -Wall -Wextra)
endif()
endforeach(executable ${executables})

Expand Down

0 comments on commit 0d1d39a

Please sign in to comment.