CMake: WITH_PYTHON_SECURITY=OFF was ignored

Allow auto-execution to be enabled,
also move this to user-prefs versioning code.
This commit is contained in:
Campbell Barton 2017-03-27 13:02:41 +11:00
parent 356aacab6b
commit 086320a62e
4 changed files with 14 additions and 9 deletions

View File

@ -69,6 +69,12 @@ if(WITH_BUILDINFO)
add_definitions(-DWITH_BUILDINFO)
endif()
if(WITH_PYTHON)
if(WITH_PYTHON_SECURITY)
add_definitions(-DWITH_PYTHON_SECURITY)
endif()
endif()
if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()

View File

@ -72,6 +72,14 @@ void BLO_update_defaults_userpref_blend(void)
/* default so DPI is detected automatically */
U.dpi = 0;
U.ui_scale = 1.0f;
#ifdef WITH_PYTHON_SECURITY
/* use alternative setting for security nuts
* otherwise we'd need to patch the binary blob - startup.blend.c */
U.flag |= USER_SCRIPT_AUTOEXEC_DISABLE;
#else
U.flag &= ~USER_SCRIPT_AUTOEXEC_DISABLE;
#endif
}
/**

View File

@ -128,10 +128,6 @@ if(WITH_PYTHON)
../python
)
add_definitions(-DWITH_PYTHON)
if(WITH_PYTHON_SECURITY)
add_definitions(-DWITH_PYTHON_SECURITY)
endif()
endif()
if(WITH_GAMEENGINE)

View File

@ -777,11 +777,6 @@ int wm_homefile_read(
if (BLI_listbase_is_empty(&wmbase)) {
wm_clear_default_size(C);
}
#ifdef WITH_PYTHON_SECURITY
/* use alternative setting for security nuts
* otherwise we'd need to patch the binary blob - startup.blend.c */
U.flag |= USER_SCRIPT_AUTOEXEC_DISABLE;
#endif
}
/* Load template preferences,