mariadb/sql/gen_sql_yacc_ora_yy.cmake
Vladislav Vaintroub bf3034195f Part2: MDEV-12518 Unify sql_yacc.yy and sql_yacc_ora.yy
Generate sql_yacc_ora.yy from sql_yacc.yy , by using cmake script
which does some simple string(REPLACE)
2019-12-04 15:45:00 +04:00

15 lines
702 B
CMake

file(READ "${IN}" yytmp)
# Comment out sql_mode=DEFAULT rules and directives (e.g. %expect, %type)
string(REPLACE "/* Start SQL_MODE_DEFAULT_SPECIFIC */"
"/* Start SQL_MODE_DEFAULT_SPECIFIC" yytmp "${yytmp}")
string(REPLACE "/* End SQL_MODE_DEFAULT_SPECIFIC */"
"End SQL_MODE_DEFAULT_SPECIFIC */" yytmp "${yytmp}")
# Uncomment sql_mode=ORACLE rules and directives
string(REPLACE "/* Start SQL_MODE_ORACLE_SPECIFIC"
"/* Start SQL_MODE_ORACLE_SPECIFIC */" yytmp "${yytmp}")
string(REPLACE "End SQL_MODE_ORACLE_SPECIFIC */"
"/* End SQL_MODE_ORACLE_SPECIFIC */" yytmp "${yytmp}")
file(WRITE "${OUT}" "${yytmp}")