Build NSS on windows using gyp/ninja

14 views
Skip to first unread message

Usha Nayak

unread,
Apr 26, 2023, 7:23:24 PM4/26/23
to dev-tec...@mozilla.org
Hello,

We have a requirement to build all third party products using std c++20

For NSS, I'm using gyp/ninja to build on Windows:
I modified %NSS%\nss/coreconf/config.gypi -> Line#425
            'cflags_cc': [
              '-std=c++20',
            ],

%NSS%\nss\coreconf\command.mk -> Line#18
           CXXSTD        = -std=c++20

How do I know these settings are picked up correctly on windows ?

For compiling c files, I probably won't see the std flag but I would think I should see incase of any cc files compilation.

Any help greatly appreciated.

Thank you !!

Martin Thomson

unread,
Apr 26, 2023, 9:14:57 PM4/26/23
to Usha Nayak, dev-tec...@mozilla.org
You should be able to run ./build.sh -v

That passes verbose options to gyp and ninja, so you should see a log that includes where MSVC is invoked.

(FWIW, I'm not aware of any problem moving from C++ 11 to C++ 20, but that requirement sounds a little silly to me.  In the C++ 11 transition we had to contend with the fact that new keywords were introduced.  We would of course be happy to take patches that fixed problems with the migration, but that's a lot of work for you with no real upside.  The code compiled with C++ 11 is unlikely to be better or worse than the same code compiled with C++ 20.)

--
You received this message because you are subscribed to the Google Groups "dev-tec...@mozilla.org" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dev-tech-cryp...@mozilla.org.
To view this discussion on the web visit https://groups.google.com/a/mozilla.org/d/msgid/dev-tech-crypto/791ff5c2-3912-4d16-8c2c-25b2ad1ce36en%40mozilla.org.

Usha Nayak

unread,
Apr 27, 2023, 8:45:04 AM4/27/23
to Martin Thomson, dev-tec...@mozilla.org
Thank you for your response. I do see the path of VS2022 V17.4.4 being used but not quite sure if it's picking up the change related to the standard I did in scripts. I should have posted the excerpts of output as well. Sorry about that. 

$ ./build.sh -c -v
....
cl -Foplerror.obj -c       -W3 -nologo -GF -Gy -FS -MD -GT -O2   -UDEBUG -U_DEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DNDEBUG=1 -DXP_PC=1 -DWIN32=1 -D_CRT_SECURE_NO_WARNINGS=1 -D_CRT_NONSTDC_NO_WARNINGS=1 -DWINNT=1 -D_AMD64_=1 -DFORCE_PR_LOG -I../../../dist/include/nspr  "/d/apps/NSS_prereq/NSS/nss-3.88/nspr/Release/lib/libc/src/../../../../lib/libc/src/plerror.c"
plerror.c

...
[256/1248] ninja -t msvc -e environment.x64 -- "c:\apps\MVS174\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\cl.exe" /nologo /showIncludes /FC @obj\gtests\google_test\gtest\src\gtest.gtest-all.obj.rsp /c ..\..\gtests\google_test\gtest\src\gtest-all.cc /Foobj\gtests\google_test\gtest\src\gtest.gtest-all.obj /Fdobj\gtests\google_test\gtest.cc.pdb

Thanks.

Martin Thomson

unread,
Apr 27, 2023, 6:00:35 PM4/27/23
to Usha Nayak, dev-tec...@mozilla.org
Yeah, it doesn't look like your change worked.  Keep looking, I guess.
Reply all
Reply to author
Forward
0 new messages