Include test sources to pick up functions and classes from the module rather than from the non-modular library which is baked into the test-main library. (#2356)
This averts linker problems: - strong ownership model: missing linker symbols - weak ownership model: duplicate linker symbols Simplify `gtest-extra.cc` while at it.
This commit is contained in:
+2
-2
@@ -41,7 +41,7 @@ function(add_fmt_test name)
|
||||
set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} -Wno-weak-vtables)
|
||||
endif ()
|
||||
elseif (ADD_FMT_TEST_MODULE)
|
||||
set(libs test-main test-module)
|
||||
set(libs gtest test-module)
|
||||
set_source_files_properties(${name}.cc PROPERTIES OBJECT_DEPENDS test-module)
|
||||
else ()
|
||||
set(libs test-main fmt)
|
||||
@@ -97,7 +97,7 @@ if (FMT_CAN_MODULE)
|
||||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
|
||||
enable_module(test-module)
|
||||
|
||||
add_fmt_test(module-test MODULE)
|
||||
add_fmt_test(module-test MODULE test-main.cc)
|
||||
if (MSVC)
|
||||
target_compile_options(test-module PRIVATE /utf-8 /Zc:__cplusplus
|
||||
/Zc:externConstexpr /Zc:inline)
|
||||
|
||||
Reference in New Issue
Block a user