mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
Windows compiler options improvements (#1709)
- Use generators to set options only during build - Add ZcThrowingNew - Disable 4996 Fixes #1699
This commit is contained in:
committed by
Peter Johnson
parent
bb48ae391e
commit
bc6f1e2469
@@ -1,7 +1,7 @@
|
||||
import edu.wpi.first.nativeutils.*
|
||||
import org.gradle.internal.os.OperatingSystem
|
||||
|
||||
def windowsCompilerArgs = ['/EHsc', '/D_CRT_SECURE_NO_WARNINGS', '/Zi', '/FS', '/Zc:inline', '/MP4', '/W3', '/wd4244', '/wd4267', '/wd4146', '/std:c++17', '/permissive-', '/WX']
|
||||
def windowsCompilerArgs = ['/EHsc', '/D_CRT_SECURE_NO_WARNINGS', '/Zi', '/FS', '/Zc:inline', '/W3', '/wd4244', '/wd4267', '/wd4146', '/wd4996', '/std:c++17', '/Zc:throwingNew', '/permissive-', '/WX']
|
||||
def windowsCCompilerArgs = ['/Zi', '/FS', '/Zc:inline', '/W3', '/WX']
|
||||
def windowsReleaseCompilerArgs = ['/O2', '/MD']
|
||||
def windowsDebugCompilerArgs = ['/Od', '/MDd']
|
||||
|
||||
@@ -78,9 +78,12 @@ set_target_properties(wpiutil PROPERTIES DEBUG_POSTFIX "d")
|
||||
set_property(TARGET wpiutil PROPERTY FOLDER "libraries")
|
||||
|
||||
if (NOT MSVC)
|
||||
target_compile_options(wpiutil PUBLIC -std=c++14 -Wall -pedantic -Wextra -Wno-unused-parameter)
|
||||
target_compile_options(wpiutil PUBLIC $<BUILD_INTERFACE:-Wall -pedantic -Wextra -Werror -Wno-unused-parameter>)
|
||||
target_compile_features(wpiutil PUBLIC cxx_std_14)
|
||||
else()
|
||||
target_compile_options(wpiutil PUBLIC /wd4244 /wd4267 /wd4146 /WX /permissive- /std:c++17)
|
||||
target_compile_options(wpiutil PUBLIC /wd4244 /wd4267 /wd4146)
|
||||
target_compile_options(wpiutil PUBLIC $<BUILD_INTERFACE:/WX /wd4996 /permissive- /Zc:throwingNew>)
|
||||
target_compile_features(wpiutil PUBLIC cxx_std_17)
|
||||
target_compile_options(wpiutil PRIVATE -D_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user