File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ add_library("printf::printf" ALIAS printf)
84
84
set (GENERATED_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR} /include" )
85
85
configure_file ("printf_config.h.in" "${GENERATED_INCLUDE_DIR} /printf_config.h" @ONLY)
86
86
target_sources (printf PRIVATE src/printf/printf.c "${GENERATED_INCLUDE_DIR} /printf_config.h" src/printf/printf.h)
87
- target_compile_definitions (printf PRIVATE PRINTF_INCLUDE_CONFIG_H)
87
+ target_compile_definitions (printf PRIVATE PRINTF_INCLUDE_CONFIG_H=1 )
88
88
target_include_directories (printf PRIVATE "$<BUILD_INTERFACE:${GENERATED_INCLUDE_DIR} >" )
89
89
90
90
if (BUILD_SHARED_LIBS )
@@ -121,6 +121,7 @@ elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
121
121
-ansi
122
122
-Wno-long-long
123
123
-Werror=declaration-after-statement
124
+ -Werror=undef
124
125
)
125
126
set_target_properties (printf PROPERTIES C_STANDARD 90)
126
127
set_target_properties (printf PROPERTIES C_STANDARD_REQUIRED ON )
Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ foreach(tgt ${test_targets})
25
25
endif ()
26
26
endforeach ()
27
27
28
+ target_compile_definitions (autotest PRIVATE PRINTF_INCLUDE_CONFIG_H=0)
28
29
add_executable (aliasing "aliasing.c" )
30
+ target_compile_definitions (aliasing PRIVATE PRINTF_INCLUDE_CONFIG_H=0)
29
31
set_target_properties (
30
32
${tgt}
31
33
PROPERTIES
@@ -88,7 +90,7 @@ if (TARGET test_suite)
88
90
# These two lines are necessary, since the test suite does not actually use the
89
91
# compiled library - it includes the library's source .c file; and that means we
90
92
# need to include the generated config.h file.
91
- target_compile_definitions (test_suite PRIVATE PRINTF_INCLUDE_CONFIG_H)
93
+ target_compile_definitions (test_suite PRIVATE PRINTF_INCLUDE_CONFIG_H=1 )
92
94
target_include_directories (
93
95
test_suite
94
96
PRIVATE
You can’t perform that action at this time.
0 commit comments