Skip to content

Commit bc7639b

Browse files
jhkim-piiclaude
andcommitted
Revert CMakeLists.txt -Werror changes
Drop the ALLOW_WARNINGS option, -Werror flag, and OpenSTAWarnings interface library. Restore original target_compile_options with generator expressions. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
1 parent 616cb62 commit bc7639b

1 file changed

Lines changed: 5 additions & 18 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ option(CUDD_DIR "CUDD BDD package directory")
3232
option(USE_TCL_READLINE "Use TCL readline package" ON)
3333
option(ENABLE_TSAN "Compile with thread santizer enabled" OFF)
3434
option(ENABLE_ASAN "Compile with address santizer enabled" OFF)
35-
option(ALLOW_WARNINGS "Allow compiler warnings without failing the build" OFF)
3635

3736
# Turn on to debug compiler args.
3837
set(CMAKE_VERBOSE_MAKEFILE OFF)
@@ -595,18 +594,6 @@ endif()
595594
# common to gcc/clang
596595
set(CXX_FLAGS -Wall -Wextra -pedantic -Wcast-qual -Wredundant-decls
597596
-Wformat-security -Werror=misleading-indentation -Wundef)
598-
if(NOT ALLOW_WARNINGS)
599-
list(APPEND CXX_FLAGS -Werror)
600-
endif()
601-
602-
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
603-
set(STA_WARNING_FLAGS ${CXX_FLAGS} -Wno-format-zero-length)
604-
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
605-
OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
606-
set(STA_WARNING_FLAGS ${CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments)
607-
else()
608-
set(STA_WARNING_FLAGS ${CXX_FLAGS})
609-
endif()
610597

611598
if(ENABLE_TSAN)
612599
message(STATUS "Thread sanitizer: ${ENABLE_TSAN}")
@@ -620,12 +607,12 @@ if(ENABLE_ASAN)
620607
set(CMAKE_EXE_LINKER_FLAGS "-fsanitize=address")
621608
endif()
622609

623-
add_library(OpenSTAWarnings INTERFACE)
624-
target_compile_options(OpenSTAWarnings
625-
INTERFACE
626-
${STA_WARNING_FLAGS}
610+
target_compile_options(OpenSTA
611+
PRIVATE
612+
$<$<CXX_COMPILER_ID:GNU>:${CXX_FLAGS} -Wno-format-zero-length>
613+
$<$<CXX_COMPILER_ID:Clang>:${CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments>
614+
$<$<CXX_COMPILER_ID:AppleClang>:${CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments>
627615
)
628-
target_link_libraries(OpenSTA OpenSTAWarnings)
629616

630617
# Disable compiler specific extensions like gnu++11.
631618
set_target_properties(OpenSTA PROPERTIES CXX_EXTENSIONS OFF)

0 commit comments

Comments
 (0)