File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -275,9 +275,19 @@ if(HARDCODE_NOT_HEADER_ONLY)
275275      "HARDCODE_NOT_HEADER_ONLY=${HARDCODE_NOT_HEADER_ONLY}  " 
276276      "and FCLIB_HEADER_ONLY=${FCLIB_HEADER_ONLY}  are inconsistent." )
277277  endif ()
278+   set (OPTDEFS FCLIB_NOT_HEADER_ONLY)
279+   if (FCLIB_WITH_MERIT_FUNCTIONS)
280+     set (OPTDEFS "${OPTDEFS} ;FCLIB_WITH_MERIT_FUNCTIONS" )
281+   endif ()
282+   set (DEFS)
283+   foreach (_D ${OPTDEFS} )
284+     set (DEFS "${DEFS} \\ n#ifndef ${_D} \\ n#define ${_D} \\ n#endif\\ n" )
285+   endforeach ()
278286  add_custom_command (
279287    OUTPUT  ${CMAKE_CURRENT_BINARY_DIR} /fclib.h
280-     COMMAND  sed -e '/@@/,/@@/d' ${CMAKE_CURRENT_SOURCE_DIR} /src/fclib.h
288+     COMMAND  cat ${CMAKE_CURRENT_SOURCE_DIR} /src/fclib.h
289+       | sed 's,/\\*@ CONFIG @\\*/,${DEFS} ,'
290+       | sed '/@@/,/@@/d'
281291      | sed 's/FCLIB_STATIC //' >fclib.h
282292    DEPENDS  ${CMAKE_CURRENT_SOURCE_DIR} /src/fclib.h
283293    WORKING_DIRECTORY  ${CMAKE_CURRENT_BINARY_DIR} 
Original file line number Diff line number Diff line change 9191#define  FCLIB_APICOMPILE 
9292#endif 
9393
94+ /*@ CONFIG @*/ 
95+ 
9496/*@@ Define FCLIB_NOT_HEADER_ONLY on the command-line when fclib is 
9597 * compiled and installed as a library.  The default is to use as a 
9698 * header-only library. */ 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments