You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
731 B
Python
27 lines
731 B
Python
tmpl = r'''#define _CRT_SECURE_NO_WARNINGS
|
|
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
|
|
#include <bits/stdc++.h>
|
|
using namespace std;
|
|
int main()
|
|
{
|
|
return 0;
|
|
}
|
|
'''
|
|
cmake_prefix = r'''
|
|
cmake_minimum_required(VERSION 3.0)
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
if(MSVC)
|
|
add_compile_options("/Zc:__cplusplus")
|
|
endif()
|
|
include_directories("D:\\PortableApps\\MSYS2\\mingw64\\include\\c++\\8.2.1\\x86_64-w64-mingw32")
|
|
'''
|
|
lst = __import__("sys").argv[1:]
|
|
for i in lst:
|
|
with open("{}.cpp".format(i), "w") as f:
|
|
f.write(tmpl)
|
|
with open("CMakeLists.txt", "w") as f:
|
|
f.write(cmake_prefix + '\n'.join([
|
|
"add_executable({fn} {fn}.cpp)".format(fn="{}".format(i))
|
|
for i in lst
|
|
]))
|