@@ -14,8 +14,7 @@ string(REPLACE "-DNDEBUG" "-UNDEBUG" CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEA
1414
1515message (STATUS "Test destination prefix: ${TESTPREFIX} " )
1616
17- function (add_testcase test type def)
18-
17+ macro (add_testcase test type def)
1918 set (lib_test test -${test}${type}${PTW32_VER} )
2019 set (dll_test test -dll-${test}${type}${PTW32_VER} )
2120
@@ -39,10 +38,10 @@ function(add_testcase test type def)
3938 add_executable (${lib_test} ${test} .c ${c_dep} )
4039 target_link_libraries (${lib_test} ${lib_lib} ${XXLIBS} )
4140 if (MSVC )
42- target_compile_options (${lib_test} PRIVATE "/nologo" )
41+ target_compile_options (${lib_test} PUBLIC "/nologo" )
4342 endif ()
44- target_compile_definitions (${lib_test} PRIVATE _CONSOLE _MBCS ${def} )
45- target_compile_options (${lib_test} PRIVATE ${extra} )
43+ target_compile_definitions (${lib_test} PUBLIC _CONSOLE _MBCS ${def} )
44+ target_compile_options (${lib_test} PUBLIC ${extra} )
4645 if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang" )
4746 # GNUmakefile compiles every test as C++:
4847 target_compile_definitions (${lib_test} PRIVATE __PtW32NoCatchWarn)
@@ -59,7 +58,7 @@ function(add_testcase test type def)
5958 add_executable (${dll_test} ${test} .c ${c_dep} )
6059 target_link_libraries (${dll_test} ${dll_lib} ${XXLIBS} )
6160 if (MSVC )
62- target_compile_options (${dll_test} PRIVATE "/nologo" )
61+ target_compile_options (${dll_test} PUBLIC "/nologo" )
6362 endif ()
6463 target_compile_definitions (${dll_test} PRIVATE _CONSOLE _MBCS ${def} )
6564 target_compile_options (${dll_test} PRIVATE ${extra} )
@@ -103,7 +102,7 @@ function(add_testcase test type def)
103102 add_test (NAME ${lib_test} COMMAND ${lib_test} )
104103 add_test (NAME ${dll_test} COMMAND ${dll_test} )
105104
106- endfunction ()
105+ endmacro ()
107106
108107
109108file (GLOB TESTS *.c)
0 commit comments