-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix MSVC CLI builds as run by the regression system. (#912)
* Fix MSVC CLI builds as run by the regression system. + After upgrading to Microsoft Visual Studio 2019 16.8.0 Preview 3, the regression system could no longer build Draco due to build errors reported in system headers pulled in by `rng/test`. This version of MSVC also pulls in a newer version of CMake. + It was determined that these build errors could be eliminated by registering the rng unit tests as C++ files instead of C files, even though their file extensions are `.c`. + Also add a couple of new warning suppressions for MSVC. The new version is more agressive in reporting warnings. Only suppress issues found in the Random123 header files (we don't need to fix the TPL code). * more cleanup for msvc build. * Go back to registering as C for all compilers except MSVC. Exclude ut_gsl.c for MSVC.
- Loading branch information
1 parent
144d4df
commit f8ea72a
Showing
6 changed files
with
59 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,7 @@ | |
# author Kelly Thompson <[email protected]> | ||
# date 2012 Aug 1 | ||
# brief Generate build project files for rng/test. | ||
# note Copyright (C) 2016-2019, Triad National Security, LLC. | ||
# All rights reserved. | ||
# note Copyright (C) 2016-2019, Triad National Security, LLC., All rights reserved. | ||
#--------------------------------------------------------------------------------------------------# | ||
project( rng_test C CXX ) | ||
|
||
|
@@ -23,14 +22,24 @@ set( random123_unit_tests | |
${PROJECT_SOURCE_DIR}/ut_aes.cpp | ||
${PROJECT_SOURCE_DIR}/ut_ars.c | ||
${PROJECT_SOURCE_DIR}/ut_carray.cpp | ||
${PROJECT_SOURCE_DIR}/ut_gsl.c | ||
${PROJECT_SOURCE_DIR}/ut_M128.cpp | ||
${PROJECT_SOURCE_DIR}/ut_uniform.cpp | ||
) | ||
|
||
# [2020-08-21 KT] The code in ut_gsl.c is not valid C++. Because this test is a mix of C and C++, | ||
# it causes issues. Most compilers are happy to compile this code with C, visual studio is not. | ||
# When marked as C++, this test fails with: | ||
# | ||
# "C:\projects\draco\src\rng\test\ut_gsl.c(62,1): error C2086: 'const gsl_rng_type \ | ||
# *gsl_rng_cbrng': redefinition" | ||
# | ||
# Indeed, reviewing the Random123 file gsl_cbrng.h reveals that that gsl_rng_type is declared twice, | ||
# first on line 68 and then again on line 125 (with an assignment this time). We can continue | ||
# building and running this tests on platforms that can processs it (all but MSVC right now). | ||
if( NOT MSVC ) | ||
list(APPEND random123_unit_tests ${PROJECT_SOURCE_DIR}/ut_gsl.c ) | ||
endif() | ||
if( R123_USE_CXX11 ) | ||
list( APPEND random123_unit_tests | ||
${PROJECT_SOURCE_DIR}/ut_Engine.cpp ) | ||
list( APPEND random123_unit_tests ${PROJECT_SOURCE_DIR}/ut_Engine.cpp ) | ||
endif() | ||
|
||
# Random123 known-answer tests | ||
|
@@ -39,6 +48,17 @@ set( random123_known_answer_tests | |
${PROJECT_SOURCE_DIR}/kat_cpp.cpp | ||
) | ||
|
||
# Some compilers (esp. MSVC) have trouble with compiling these files as C11 code, so tell cmake | ||
# to treat them as C++14. ut_gsl.c has a bug that prevents it from compiling as C++, so we omit it | ||
# from this list. | ||
if( MSVC ) | ||
set_source_files_properties( | ||
${PROJECT_SOURCE_DIR}/time_serial.c | ||
${PROJECT_SOURCE_DIR}/ut_ars.c | ||
${PROJECT_SOURCE_DIR}/kat_c.c | ||
PROPERTIES LANGUAGE CXX ) | ||
endif() | ||
|
||
#--------------------------------------------------------------------------------------------------# | ||
# Build Unit tests | ||
#--------------------------------------------------------------------------------------------------# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters