Created
June 7, 2019 18:06
-
-
Save dragon512/41ed7ed7dd7b2c746dc6b98021a3f1ec to your computer and use it in GitHub Desktop.
Directory node scan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def scan_target(node, env, path, builder): | |
print("Target {} scanner ------".format(builder),node,path,env.get("SOURCE")) | |
return [] | |
def scan_source(node, env, path, builder): | |
print("Source {} scanner ------".format(builder),node,path,env.get("SOURCE")) | |
return [] | |
# generate the build files | |
env.CCommand( | |
["Makefile"], | |
["${CHECK_OUT_DIR}/CMakeLists.txt"], | |
"cd ${TARGET.dir} ; cmake ${SOURCE.dir.abspath}\ | |
-DCMAKE_INSTALL_PREFIX=${__env__.Dir('$BUILD_DIR/DESTDIR').abspath}/${PART_NAME}\ | |
-DCMAKE_INSTALL_LIBDIR=lib\ | |
-DCMAKE_BUILD_TYPE=Release", | |
source_scanner=Scanner(lambda node, env, path: scan_source(node, env, path,"GEN makefile")), | |
target_scanner=Scanner(lambda node, env, path: scan_target(node, env, path,"GEN makefile")) | |
) | |
# build the code | |
env.CCommand( | |
[ | |
env.Dir("DESTDIR/${PART_NAME}"), | |
], | |
["Makefile"], | |
[ | |
"cd ${{SOURCE.dir}} ; cmake --build . --config Release --target install -- VERBOSE=1 CC=${{CC}} CXX=${{CXX}} $(-j{jobs}$)".format( | |
jobs=env.GetOption('num_jobs')) | |
], | |
source_scanner=Scanner(lambda node, env, path: scan_source(node, env, path,"Build makefile")), | |
target_scanner=Scanner(lambda node, env, path: scan_target(node, env, path,"Build makefile")) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment