mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-03 22:54:39 +00:00
fix module compilation with clang on windows when std module is disabled
This commit is contained in:
parent
7f5de9ab25
commit
24569f69e8
@ -29,15 +29,22 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
module;
|
||||
|
||||
#ifndef ARGPARSE_MODULE_USE_STD_MODULE
|
||||
#include <argparse/argparse.hpp>
|
||||
#endif
|
||||
|
||||
export module argparse;
|
||||
|
||||
#ifdef ARGPARSE_MODULE_USE_STD_MODULE
|
||||
import std;
|
||||
#endif
|
||||
|
||||
extern "C++" {
|
||||
#include <argparse/argparse.hpp>
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
export namespace argparse {
|
||||
using argparse::nargs_pattern;
|
||||
|
@ -4,6 +4,7 @@ set_project("argparse")
|
||||
set_version("2.9.0", { build = "%Y%m%d%H%M" })
|
||||
|
||||
option("enable_module")
|
||||
option("enable_std_import", { defines = "ARGPARSE_MODULE_USE_STD_MODULE" })
|
||||
option("enable_tests")
|
||||
option("enable_samples")
|
||||
|
||||
@ -28,7 +29,9 @@ target("argparse", function()
|
||||
if get_config("enable_module") then
|
||||
set_languages("c++20")
|
||||
set_kind("static") -- static atm because of a XMake bug, headeronly doesn't generate package module metadata
|
||||
else
|
||||
end
|
||||
|
||||
add_options("enable_std_import")
|
||||
|
||||
add_includedirs("include", { public = true })
|
||||
add_headerfiles("include/argparse/argparse.hpp")
|
||||
|
Loading…
Reference in New Issue
Block a user