-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve CSP Generation #336
Comments
@rbugajewski If you use drogon_ctl to create a project(drogon_ctl create project ...), you will find some lines in the CMakeLists.txt file as follows: file(GLOB SCP_LIST ${CMAKE_CURRENT_SOURCE_DIR}/views/*.csp)
foreach(cspFile ${SCP_LIST})
message(STATUS "cspFile:" ${cspFile})
get_filename_component(classname ${cspFile} NAME_WE)
message(STATUS "view classname:" ${classname})
ADD_CUSTOM_COMMAND(OUTPUT ${classname}.h ${classname}.cc
COMMAND drogon_ctl
ARGS create view ${cspFile}
DEPENDS ${cspFile}
VERBATIM )
set(VIEWSRC ${VIEWSRC} ${classname}.cc)
endforeach() This means that you do not need to manually create the source files for views. These files are created automatically by cmake in the building directory. |
@an-tao Thanks for your answer, in fact I’ve already set it up this way. Maybe this is related to the |
Oh, I get it. If load_dynamic_views is enabled, drogon will automatically create source files in the path where the csp files are located and compile them. I haven't thought about it carefully, sorry. I will find a solution. |
@rbugajewski I added a new option |
I just checked out and smoke tested the Thank you very much. |
When using CSP, the
drogon_ctl
command creates its build artifacts in the same directory as the*.csp
files. This is quite annoying, because it pollutes a directory that is supposed to be part of the source files. For example when I have a template calledAbout.csp
, I get the following files as a result:About.cc
About.h
About.so
About.so.dSYM/
As these files aren’t meant to be user-editable, I would greatly prefer to have them reside in a completely different directory.
The text was updated successfully, but these errors were encountered: