forked from 1dot13/source
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
requires clang/lld or mingw, obviously just make sure the MSVC_DIRECTORY env variable points to valid Visual Studio Build Tools directory and do: `cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=clang_or_mingw_toolchain_file`
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
set(CMAKE_SYSTEM_NAME Windows) | ||
|
||
set(CMAKE_C_COMPILER clang) | ||
set(CMAKE_CXX_COMPILER clang++) | ||
set(CMAKE_RC_COMPILER llvm-rc) | ||
|
||
set(triple i386-pc-win32-msvc) | ||
set(CMAKE_C_COMPILER_TARGET ${triple}) | ||
set(CMAKE_CXX_COMPILER_TARGET ${triple}) | ||
set(CMAKE_RC_COMPILER_TARGET ${triple}) | ||
|
||
set(msvc_dir "$ENV{MSVC_DIRECTORY}") | ||
if(msvc_dir STREQUAL "") | ||
message(FATAL_ERROR "Please set a valid MSVC_DIRECTORY environment variable") | ||
endif() | ||
|
||
# Don't remember which version of Visual Studio Build Tools this is. | ||
# When updating this, make sure to pin the version so people can get it. | ||
set(msvc_include | ||
"${msvc_dir}/14.34.31933/include" | ||
"${msvc_dir}/14.34.31933/ATLMFC/include" | ||
"${msvc_dir}/include/10.0.22000.0/ucrt" | ||
"${msvc_dir}/include/10.0.22000.0/um" | ||
"${msvc_dir}/include/10.0.22000.0/shared" | ||
"${msvc_dir}/include/10.0.22000.0/winrt" | ||
"${msvc_dir}/include/10.0.22000.0/cppwinrt" | ||
) | ||
set(msvc_libraries | ||
"${msvc_dir}/14.34.31933/ATLMFC/lib/x86" | ||
"${msvc_dir}/14.34.31933/lib/x86" | ||
"${msvc_dir}/lib/10.0.22000.0/ucrt/x86" | ||
"${msvc_dir}/lib/10.0.22000.0/um/x86" | ||
) | ||
|
||
foreach(LANG C CXX) | ||
set(CMAKE_${LANG}_STANDARD_INCLUDE_DIRECTORIES ${msvc_include}) | ||
endforeach() | ||
|
||
link_directories(${msvc_libraries}) |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
set(CMAKE_SYSTEM_NAME Windows) | ||
set(CMAKE_SYSTEM_PROCESSOR i686) | ||
|
||
set(triple ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32) | ||
|
||
set(CMAKE_C_COMPILER ${triple}-gcc) | ||
set(CMAKE_CXX_COMPILER ${triple}-g++) | ||
set(CMAKE_RC_COMPILER ${triple}-windres) | ||
|
||
set(CMAKE_C_COMPILER_TARGET ${triple}) | ||
set(CMAKE_CXX_COMPILER_TARGET ${triple}) |