diff --git a/CMakeLists.txt b/CMakeLists.txt index 8215105..d056c7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,12 @@ set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) include(CPack) include(Doxycelli) +if (MSVC) + add_compile_options(/W4 /WX) +else() + add_compile_options(-Wall -Wextra -pedantic -Werror) +endif() + add_subdirectory(src) install(FILES README.md LICENSE.txt DESTINATION doc/monicelli) diff --git a/cmake/FindRagel.cmake b/cmake/FindRagel.cmake index 24bcbd3..52c7501 100644 --- a/cmake/FindRagel.cmake +++ b/cmake/FindRagel.cmake @@ -29,8 +29,10 @@ function(add_ragel_library name ragel_source) CXX_STANDARD_REQUIRED true ) - # The lexer uses implicit fallthroughs all over, but it's OK. - target_compile_options(${name} PRIVATE -Wno-implicit-fallthrough) + if (NOT MSVC) + # The lexer uses implicit fallthroughs all over, but it's OK. + target_compile_options(${name} PRIVATE -Wno-implicit-fallthrough) + endif() target_include_directories(${name} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) endfunction() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5d61f2f..9d6fdce 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -33,14 +33,12 @@ add_executable(mcc operators.def ) -set_target_properties(mcc +set_target_properties(mcc lexer PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED true ) -target_compile_options(mcc PRIVATE -Wall -Wextra -Werror) - target_link_libraries(mcc PRIVATE lexer) llvm_config(mcc