forked from flashlight/flashlight
-
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.
Add Windows/MSVC support (flashlight#1107)
Summary: Implement changes to support compilation with MSVC. This tests the Flashlight core with MSVC 2019; won't expand to apps/pkgs for now/will gate compilation given dependencies therein that aren't supported on Windows. Required changes include: - initialize the `flashlight` target after compiler options are set, and move those up. Eventually, this should probably be public properties of the `flashlight` target - Add `\bigobj` as an MSVC compiler option since we aren't currently explicitly exporting symbols - Don't bother checking for `-rdynamic` with windows because I don't want to support plugins for it anyways - Introduce `FL_BUILD_PLUGIN` as a set option per the above to enforce the correct behavior - Swap from `math.h` to `cmath` and compile with required `_USE_MATH_DEFINES` and `NOMINMAX` for `M_PI` and friends - MSVC hates implicit overloads that cast from `std::string` to `std::filesystem::path` in argument lists (when used as refs) -- change the FL serialization API to rely on `fs::path` as the arg - missing headers throughout - some missing lambda captures that gcc/clang totally ignored - MSVC 2019 doesn't allow aggregate initialization, sad - don't check and optionally use `std::filesystem` linker flags with MSVC; no additional linking is required Pull Request resolved: flashlight#1107 Test Plan: local compilation with MSVC 2019 on Windows 11, test with toy CI baselines Reviewed By: bwasti Differential Revision: D46080426 Pulled By: jacobkahn fbshipit-source-id: f006e68aea9d798da72621e5d7538752e786d99b
- Loading branch information
1 parent
861502d
commit f0e85e3
Showing
21 changed files
with
175 additions
and
133 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 |
---|---|---|
|
@@ -51,3 +51,5 @@ wheels/ | |
|
||
# Dev environment | ||
.vscode | ||
.vs | ||
CMakeSettings.json |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
#pragma once | ||
|
||
#include <variant> | ||
#include <optional> | ||
|
||
#include "flashlight/fl/tensor/TensorBase.h" | ||
|
||
|
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
Oops, something went wrong.