Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-3952] cmake build is incorrectly adding an argument of /wd4068 on mac os x builds #46537

Closed
phausler opened this issue Feb 13, 2017 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. build-script Area → utils: The build script

Comments

@phausler
Copy link
Member

Previous ID SR-3952
Radar None
Original Reporter @phausler
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Project Infrastructure
Labels Bug, BuildScript
Assignee hughbe (JIRA)
Priority Medium

md5: 3d0d2fd968181aca65be592d70eda125

Issue Description:

This is occurring from the cmake build script options from swift/cmake/modules/SwiftSharedCMakeConfig.cmake

  check_cxx_compiler_flag("/wd4068" CXX_SUPPORTS_UNKNOWN_PRAGMA_FLAG)
  append_if(CXX_SUPPORTS_UNKNOWN_PRAGMA_FLAG "/wd4068" CMAKE_CXX_FLAGS)

Performing C++ SOURCE FILE Test LINKER_SUPPORTS_COLOR_DIAGNOSTICS failed with the following output:
Change Dir: /Volumes/Users/phausler/Documents/Public/swift_stable/build/custom/swift-macosx-x86_64/CMakeFiles/CMakeTmp

Run Build Command:"/Volumes/Users/phausler/Documents/Public/swift_stable/build/custom/ninja-build/ninja" "cmTC_41c18"
[1/2] Building CXX object CMakeFiles/cmTC_41c18.dir/src.cxx.o
clang: warning: -Wl,-color-diagnostics: 'linker' input unused [-Wunused-command-line-argument]
[2/2] Linking CXX executable cmTC_41c18
FAILED: cmTC_41c18 
: && /Volumes/Users/phausler/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++   -fno-stack-protector -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -Werror=date-time -std=c++11 -fcolor-diagnostics -DLINKER_SUPPORTS_COLOR_DIAGNOSTICS  -Wl,-color-diagnostics -isysroot /Volumes/Users/phausler/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -stdlib=libc++ CMakeFiles/cmTC_41c18.dir/src.cxx.o  -o cmTC_41c18   && :
ld: unknown option: -color-diagnostics
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

Source file was:
int main() { return 0; }
Performing C++ SOURCE FILE Test CXX_SUPPORTS_UNKNOWN_PRAGMA_FLAG failed with the following output:
Change Dir: /Volumes/Users/phausler/Documents/Public/swift_stable/build/custom/swift-macosx-x86_64/CMakeFiles/CMakeTmp

Run Build Command:"/Volumes/Users/phausler/Documents/Public/swift_stable/build/custom/ninja-build/ninja" "cmTC_3eb1f"
[1/2] Building CXX object CMakeFiles/cmTC_3eb1f.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_3eb1f.dir/src.cxx.o 
/Volumes/Users/phausler/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++     -fno-stack-protector -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -Werror=date-time -std=c++11 -fcolor-diagnostics -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DCXX_SUPPORTS_UNKNOWN_PRAGMA_FLAG -isysroot /Volumes/Users/phausler/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk   /wd4068 -o CMakeFiles/cmTC_3eb1f.dir/src.cxx.o -c /Volumes/Users/phausler/Documents/Public/swift_stable/build/custom/swift-macosx-x86_64/CMakeFiles/CMakeTmp/src.cxx
clang: error: no such file or directory: '/wd4068'
ninja: build stopped: subcommand failed.

Source file was:
int main() { return 0; }
@belkadan
Copy link
Contributor

cc hughbe (JIRA User), erg (JIRA User)

@swift-ci
Copy link
Collaborator

Comment by Doug Coleman (JIRA)

Looks like the f446dd0 patch needs a conditional to only include the warning suppression on Windows.

I will have a CI job to detect changes like this in the future.

@swift-ci
Copy link
Collaborator

Comment by Hugh Bellamy (JIRA)

I'm really not sure what is causing this, I never had any issues on my machine.

Anyways, see #7450

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. build-script Area → utils: The build script
Projects
None yet
Development

No branches or pull requests

3 participants