From b7f890adb32e20dfd598daa8ba6ff6e7ecb99634 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Wed, 22 Oct 2014 19:25:59 -0400 Subject: [PATCH] Fix parallel build bugs. * Make all files generated by make_lexer() dependencies of thier respective build targets. * Make building Boost a dependency for all libraries. * Remove duplicate make_lexer() call for Specctra lexer files. --- CMakeLists.txt | 1 + common/CMakeLists.txt | 60 +++++++++++++++++++++++-- eeschema/CMakeLists.txt | 85 ++++++++++++++++++++++------------- pcb_calculator/CMakeLists.txt | 35 +++++++++------ pcbnew/CMakeLists.txt | 14 +----- 5 files changed, 136 insertions(+), 59 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 05ebb9909d..02193fc061 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -563,6 +563,7 @@ WARNING: You decided to skip building boost library. KiCad developers strongly advise you to build the bundled boost library, as it is known to work with KiCad. Other versions may contain bugs that may result in KiCad errors." ) else() + add_dependencies( lib-dependencies boost ) include( download_boost ) endif() diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 6032ff9117..05822f5e35 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -20,12 +20,12 @@ add_custom_command( -P ${CMAKE_MODULE_PATH}/Shaders.cmake WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/common/gal/opengl COMMENT "Generating headers containing GLSL source code" -) + ) add_custom_target( shader_headers ALL DEPENDS gal/opengl/shader_src.h -) + ) set( GAL_SRCS # Common part @@ -241,7 +241,7 @@ set( COMMON_SRCS geometry/shape_line_chain.cpp geometry/shape_collisions.cpp geometry/shape_index.cpp -) + ) add_library( common STATIC ${COMMON_SRCS} ) add_dependencies( common lib-dependencies ) @@ -326,6 +326,15 @@ make_lexer( specctra.h ) +add_custom_target( + specctra_lexer_source_files ALL + DEPENDS + ${PROJECT_SOURCE_DIR}/pcbnew/specctra_lexer.h + ${PROJECT_SOURCE_DIR}/pcbnew/specctra_keywords.cpp + ) + +add_dependencies( pcbcommon specctra_lexer_source_files ) + # auto-generate netlist_lexer.h and netlist_keywords.cpp make_lexer( ${CMAKE_CURRENT_SOURCE_DIR}/netlist.keywords @@ -337,6 +346,15 @@ make_lexer( ${CMAKE_PROJECT_SOURCE_DIR}/pcbnew/netlist_reader.h ) +add_custom_target( + netlist_lexer_source_files ALL + DEPENDS + ${PROJECT_SOURCE_DIR}/include/netlist_lexer.h + ${CMAKE_CURRENT_SOURCE_DIR}/netlist_keywords.cpp + ) + +add_dependencies( common netlist_lexer_source_files ) + # auto-generate pcb_plot_params_lexer.h and pcb_plot_params_keywords.cpp make_lexer( ${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params.keywords @@ -348,6 +366,15 @@ make_lexer( ${PROJECT_SOURCE_DIR}/pcbnew/pcb_plot_params.h ) +add_custom_target( + pcb_plot_lexer_source_files ALL + DEPENDS + ${PROJECT_SOURCE_DIR}/include/pcb_plot_params_lexer.h + ${CMAKE_CURRENT_SOURCE_DIR}/pcb_plot_params_keywords.cpp + ) + +add_dependencies( pcbcommon pcb_plot_lexer_source_files ) + # auto-generate pcbnew_sexpr.h and pcbnew_sexpr.cpp make_lexer( ${CMAKE_CURRENT_SOURCE_DIR}/pcb.keywords @@ -359,6 +386,15 @@ make_lexer( ${PROJECT_SOURCE_DIR}/pcbnew/pcb_parser.h ) +add_custom_target( + pcb_lexer_source_files ALL + DEPENDS + ${PROJECT_SOURCE_DIR}/include/pcb_lexer.h + ${CMAKE_CURRENT_SOURCE_DIR}/pcb_keywords.cpp + ) + +add_dependencies( pcbcommon pcb_lexer_source_files ) + # auto-generate pcbnew s-expression footprint library table code. make_lexer( ${CMAKE_CURRENT_SOURCE_DIR}/fp_lib_table.keywords @@ -367,6 +403,15 @@ make_lexer( FP_LIB_TABLE_T ) +add_custom_target( + fp_lib_table_lexer_source_files ALL + DEPENDS + ${PROJECT_SOURCE_DIR}/include/fp_lib_table_lexer.h + ${CMAKE_CURRENT_SOURCE_DIR}/fp_lib_table_keywords.cpp + ) + +add_dependencies( pcbcommon fp_lib_table_lexer_source_files ) + # auto-generate page layout reader s-expression page_layout_reader_lexer.h # and title_block_reader_keywords.cpp. make_lexer( @@ -376,6 +421,15 @@ make_lexer( TB_READER_T ) +add_custom_target( + page_layout_lexer_source_files ALL + DEPENDS + ${PROJECT_SOURCE_DIR}/include/page_layout_reader_lexer.h + ${CMAKE_CURRENT_SOURCE_DIR}/page_layout/page_layout_reader_keywords.cpp + ) + +add_dependencies( common page_layout_lexer_source_files ) + # This one gets made only when testing. # to build it, first enable #define STAND_ALONE at top of dsnlexer.cpp add_executable( dsntest EXCLUDE_FROM_ALL dsnlexer.cpp ) diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index 4fc72d6184..78ccc5d41c 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -186,36 +186,6 @@ if( MINGW ) mingw_resource_compiler( eeschema ) endif() - -# auto-generate cmp_library_lexer.h and cmp_library_keywords.cpp for the component -# library format. -make_lexer( - ${CMAKE_CURRENT_SOURCE_DIR}/cmp_library.keywords - ${CMAKE_CURRENT_SOURCE_DIR}/cmp_library_lexer.h - ${CMAKE_CURRENT_SOURCE_DIR}/cmp_library_keywords.cpp - TLIB_T - ) - -make_lexer( - ${CMAKE_CURRENT_SOURCE_DIR}/template_fieldnames.keywords - ${CMAKE_CURRENT_SOURCE_DIR}/template_fieldnames_lexer.h - ${CMAKE_CURRENT_SOURCE_DIR}/template_fieldnames_keywords.cpp - TFIELD_T - - # Pass header file with dependency on *_lexer.h as extra_arg - template_fieldnames.h - ) - -make_lexer( - ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_cfg.keywords - ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_cfg_lexer.h - ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_cfg_keywords.cpp - T_BOMCFG_T - - # Pass header file with dependency on *_lexer.h as extra_arg - dialogs/dialog_bom_cfg.h - ) - # Create a C++ compilable string initializer containing html text into a *.h file: add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_help_html.h @@ -373,5 +343,60 @@ else() endif() +# auto-generate cmp_library_lexer.h and cmp_library_keywords.cpp for the component +# library format. +make_lexer( + ${CMAKE_CURRENT_SOURCE_DIR}/cmp_library.keywords + ${CMAKE_CURRENT_SOURCE_DIR}/cmp_library_lexer.h + ${CMAKE_CURRENT_SOURCE_DIR}/cmp_library_keywords.cpp + TLIB_T + ) + +add_custom_target( + cmp_library_lexer_source_files ALL + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/cmp_library_lexer.h + ${CMAKE_CURRENT_SOURCE_DIR}/cmp_library_keywords.cpp + ) + +add_dependencies( eeschema_kiface cmp_library_lexer_source_files ) + +make_lexer( + ${CMAKE_CURRENT_SOURCE_DIR}/template_fieldnames.keywords + ${CMAKE_CURRENT_SOURCE_DIR}/template_fieldnames_lexer.h + ${CMAKE_CURRENT_SOURCE_DIR}/template_fieldnames_keywords.cpp + TFIELD_T + + # Pass header file with dependency on *_lexer.h as extra_arg + template_fieldnames.h + ) + +add_custom_target( + field_template_lexer_source_files ALL + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/template_fieldnames_lexer.h + ${CMAKE_CURRENT_SOURCE_DIR}/template_fieldnames_keywords.cpp + ) + +add_dependencies( eeschema_kiface field_template_lexer_source_files ) + +make_lexer( + ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_cfg.keywords + ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_cfg_lexer.h + ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_cfg_keywords.cpp + T_BOMCFG_T + + # Pass header file with dependency on *_lexer.h as extra_arg + dialogs/dialog_bom_cfg.h + ) + +add_custom_target( + dialog_bom_cfg_lexer_source_files ALL + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_cfg_lexer.h + ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_bom_cfg_keywords.cpp + ) + +add_dependencies( eeschema_kiface dialog_bom_cfg_lexer_source_files ) add_subdirectory( plugins ) diff --git a/pcb_calculator/CMakeLists.txt b/pcb_calculator/CMakeLists.txt index 1f3f552a9e..172fa7f26c 100644 --- a/pcb_calculator/CMakeLists.txt +++ b/pcb_calculator/CMakeLists.txt @@ -39,21 +39,9 @@ set( PCB_CALCULATOR_SRCS if( MINGW ) # PCB_CALCULATOR_RESOURCES variable is set by the macro. - mingw_resource_compiler(pcb_calculator) + mingw_resource_compiler( pcb_calculator ) endif() -# auto-generate pcb_calculator_datafile.h and pcb_calculator_datafile_keywords.cpp -# for the storage data file format. -make_lexer( - ${CMAKE_CURRENT_SOURCE_DIR}/pcb_calculator_datafile.keywords - ${CMAKE_CURRENT_SOURCE_DIR}/pcb_calculator_datafile_lexer.h - ${CMAKE_CURRENT_SOURCE_DIR}/pcb_calculator_datafile_keywords.cpp - PCBCALC_DATA_T - - # Pass header file with dependency on *_lexer.h as extra_arg - datafile_read_write.h - ) - if( APPLE ) # setup bundle set( PCB_CALCULATOR_RESOURCES pcb_calculator.icns ) @@ -182,3 +170,24 @@ else() ) endif() + +# auto-generate pcb_calculator_datafile.h and pcb_calculator_datafile_keywords.cpp +# for the storage data file format. +make_lexer( + ${CMAKE_CURRENT_SOURCE_DIR}/pcb_calculator_datafile.keywords + ${CMAKE_CURRENT_SOURCE_DIR}/pcb_calculator_datafile_lexer.h + ${CMAKE_CURRENT_SOURCE_DIR}/pcb_calculator_datafile_keywords.cpp + PCBCALC_DATA_T + + # Pass header file with dependency on *_lexer.h as extra_arg + datafile_read_write.h + ) + +add_custom_target( + pcb_calculator_lexer_source_files ALL + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/pcb_calculator_datafile_lexer.h + ${CMAKE_CURRENT_SOURCE_DIR}/pcb_calculator_datafile_keywords.cpp +) + +add_dependencies( pcb_calculator_kiface pcb_calculator_lexer_source_files ) diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 23538faef5..9a1e6e923a 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -505,20 +505,8 @@ set_source_files_properties( dialogs/dialog_freeroute_exchange.cpp PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/dialog_freeroute_exchange_help_html.h ) - -# auto-generate specctra_lexer.h and specctra_keywords.cpp -make_lexer( - ${CMAKE_CURRENT_SOURCE_DIR}/specctra.keywords - ${CMAKE_CURRENT_SOURCE_DIR}/specctra_lexer.h - ${CMAKE_CURRENT_SOURCE_DIR}/specctra_keywords.cpp - DSN - - # Pass header file with dependency on *_lexer.h as extra_arg - specctra.h - ) - - add_subdirectory( pcad2kicadpcb_plugin ) + if( BUILD_GITHUB_PLUGIN ) add_subdirectory( github ) add_dependencies( github_plugin lib-dependencies )