Skip to content

Commit

Permalink
Remove /Oy- option for MSVC in CMakeLists.txt and set HAS_MSVC_NO_OMI…
Browse files Browse the repository at this point in the history
…T_FRAME_POINTER flag
  • Loading branch information
riccardodebenedictis committed Dec 31, 2024
1 parent 2efc613 commit 6fbb5a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ if(BUILD_TESTING)
endif()

if(MSVC)
target_compile_options(oRatioLib PRIVATE /W4 /Oy-)
target_compile_options(oRatioLib PRIVATE /W4)
set(HAS_MSVC_NO_OMIT_FRAME_POINTER ON CACHE BOOL "MSVC has no -fomit-frame-pointer" FORCE)
else()
target_compile_options(oRatioLib PRIVATE -Wall -Wextra -Wpedantic -fsanitize=undefined)
if (ENABLE_COVERAGE)
Expand Down
4 changes: 2 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ add_executable(core_tests test_core.cpp)
add_dependencies(core_tests oRatioLib)
target_link_libraries(core_tests PRIVATE oRatioLib)
if(MSVC)
target_compile_options(core_tests PRIVATE /W4 /Oy-)
target_compile_options(core_tests PRIVATE /W4)
else()
target_compile_options(core_tests PRIVATE -Wall -Wextra -Wpedantic -fsanitize=undefined)
target_link_options(core_tests PRIVATE -fsanitize=undefined)
Expand All @@ -19,7 +19,7 @@ add_dependencies(solver_tests oRatioLib)
target_compile_definitions(solver_tests PRIVATE NUM_TESTS=1)
target_link_libraries(solver_tests PRIVATE oRatioLib)
if(MSVC)
target_compile_options(solver_tests PRIVATE /W4 /Oy-)
target_compile_options(solver_tests PRIVATE /W4)
else()
target_compile_options(solver_tests PRIVATE -Wall -Wextra -Wpedantic -fsanitize=undefined)
target_link_options(solver_tests PRIVATE -fsanitize=undefined)
Expand Down

0 comments on commit 6fbb5a9

Please sign in to comment.