{
    "variables": {
        "module_name%": "node_printer",
        "module_path%": "lib"
    },
    "targets": [
        {
            "target_name": "action_after_build",
            "type": "none",
            "dependencies": [
                "<(module_name)"
            ],
            "copies": [
                {
                    "files": [
                        "<(PRODUCT_DIR)/<(module_name).node"
                    ],
                    "destination": "<(module_path)"
                }
            ],
            "cflags_cc": [
                "-std=c++20"
            ],
            "conditions": [
                [
                    "OS==\"mac\"",
                    {
                        "xcode_settings": {
                            "OTHER_CFLAGS": [
                                "-std=c++20",
                                "-stdlib=libc++"
                            ],
                            "OTHER_LDFLAGS": [
                                "-stdlib=libc++"
                            ]
                        }
                    }
                ],
                [
                    "OS==\"win\"",
                    {
                        "msvs_settings": {
                            "VCCLCompilerTool": {
                                "AdditionalOptions": [
                                    "/std:c++20"
                                ]
                            },
                            "ClCompile": {
                                "LanguageStandard": "stdcpp20"
                            }
                        }
                    }
                ],
                [
                    "OS==\"mac\"",
                    {
                        "xcode_settings": {
                            "OTHER_CFLAGS": [
                                "-arch x86_64",
                                "-arch arm64"
                            ],
                            "OTHER_LDFLAGS": [
                                "-arch x86_64",
                                "-arch arm64"
                            ]
                        }
                    }
                ]
            ]
        },
        {
            "target_name": "node_printer",
            "sources": [
                "<!@([\"python\", \"tools/getSourceFiles.py\", \"src\", \"cc\"])"
            ],
            "include_dirs": [
                "<!(node -e \"require('nan')\")"
            ],
            "cflags_cc+": [
                "-Wno-deprecated-declarations"
            ],
            "conditions": [
                [
                    "OS!=\"linux\"",
                    {
                        "sources/": [
                            [
                                "exclude",
                                "_linux\\.cc$"
                            ]
                        ]
                    }
                ],
                [
                    "OS!=\"mac\"",
                    {
                        "sources/": [
                            [
                                "exclude",
                                "_mac\\.cc|mm?$"
                            ]
                        ]
                    }
                ],
                [
                    "OS!=\"win\"",
                    {
                        "sources/": [
                            [
                                "exclude",
                                "_win\\.cc$"
                            ]
                        ]
                    },
                    {
                        "sources/": [
                            [
                                "exclude",
                                "_posix\\.cc$"
                            ]
                        ]
                    }
                ],
                [
                    "OS!=\"win\"",
                    {
                        "cflags": [
                            "<!(cups-config --cflags)"
                        ],
                        "ldflags": [
                            "<!(cups-config --libs)"
                        ],
                        "libraries": [
                            "<!(cups-config --libs)"
                        ],
                        "link_settings": {
                            "libraries": [
                                "<!(cups-config --libs)"
                            ]
                        }
                    }
                ],
                [
                    "OS==\"mac\"",
                    {
                        "cflags": [
                            "-stdlib=libc++"
                        ],
                        "xcode_settings": {
                            "OTHER_LDFLAGS": [
                                "-stdlib=libc++"
                            ],
                            "MACOSX_DEPLOYMENT_TARGET": "10.7",
                            "OTHER_CFLAGS": [
                                "-std=c++14",
                                "-stdlib=libc++"
                            ]
                        }
                    }
                ],
                [
                    "OS==\"mac\"",
                    {
                        "xcode_settings": {
                            "OTHER_CFLAGS": [
                                "-std=c++20",
                                "-stdlib=libc++"
                            ],
                            "OTHER_LDFLAGS": [
                                "-stdlib=libc++"
                            ]
                        }
                    }
                ],
                [
                    "OS==\"win\"",
                    {
                        "msvs_settings": {
                            "VCCLCompilerTool": {
                                "AdditionalOptions": [
                                    "/std:c++20"
                                ]
                            },
                            "ClCompile": {
                                "LanguageStandard": "stdcpp20"
                            }
                        }
                    }
                ],
                [
                    "OS==\"mac\"",
                    {
                        "xcode_settings": {
                            "OTHER_CFLAGS": [
                                "-arch x86_64",
                                "-arch arm64"
                            ],
                            "OTHER_LDFLAGS": [
                                "-arch x86_64",
                                "-arch arm64"
                            ]
                        }
                    }
                ]
            ],
            "cflags_cc": [
                "-std=c++20"
            ]
        }
    ]
}