diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2015-09-29 17:23:55 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2015-09-29 17:23:55 (GMT) |
commit | e8073c0d80189b1d1c8e5df94abe72b249f5aab8 (patch) | |
tree | a0ff3ef4cca04f9891553ce2700167f233317548 /config/cmake | |
parent | ea70d11227bee77e9fc34f0435165365842bd138 (diff) | |
download | hdf5-e8073c0d80189b1d1c8e5df94abe72b249f5aab8.zip hdf5-e8073c0d80189b1d1c8e5df94abe72b249f5aab8.tar.gz hdf5-e8073c0d80189b1d1c8e5df94abe72b249f5aab8.tar.bz2 |
[svn-r27910] Rework flex-bison generated files to eliminate dual depends when building both shared and static
Diffstat (limited to 'config/cmake')
-rw-r--r-- | config/cmake/HDF5_Process_Flex_Files.cmake | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/config/cmake/HDF5_Process_Flex_Files.cmake b/config/cmake/HDF5_Process_Flex_Files.cmake index 6ada04c..2306e93 100644 --- a/config/cmake/HDF5_Process_Flex_Files.cmake +++ b/config/cmake/HDF5_Process_Flex_Files.cmake @@ -1,6 +1,6 @@ # post process flex/bison files -message (STATUS "File: ${FILE_PARSE} ${FILE_ANALYZE}") +message (STATUS "File: ${GEN_DIR} ${FILE_PARSE} ${FILE_ANALYZE}") if (FILE_PARSE) # fix H5LTparse.c to declare H5LTyyparse return type as an hid_t @@ -11,19 +11,19 @@ if (FILE_PARSE) # I propose to not use flex to generate this function, but for now I am # adding a perl command to find and replace this function declaration in # H5LTparse.c. - file (READ ${FILE_PARSE} TEST_STREAM) + file (READ ${GEN_DIR}/${FILE_PARSE}.c TEST_STREAM) string (REGEX REPLACE "int yyparse" "hid_t yyparse" TEST_STREAM "${TEST_STREAM}") string (REGEX REPLACE "int\nyyparse" "hid_t\nyyparse" TEST_STREAM "${TEST_STREAM}") string (REGEX REPLACE "int H5LTyyparse" "hid_t H5LTyyparse" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${FILE_PARSE} "${TEST_STREAM}") + file (WRITE ${FILE_PARSE}.c "${TEST_STREAM}") message (STATUS "replacing signature in H5LTparse.c") # Add code that disables warnings in the flex/bison-generated code. # # Note that the GCC pragmas did not exist until gcc 4.2. Earlier versions # will simply ignore them, but we want to avoid those warnings. - file (READ ${FILE_PARSE} TEST_STREAM) - file (WRITE ${FILE_PARSE} " + file (READ ${FILE_PARSE}.c TEST_STREAM) + file (WRITE ${FILE_PARSE}.c " #if __GNUC__ >= 4 && __GNUC_MINOR__ >=2\n #pragma GCC diagnostic ignored \"-Wconversion\"\n #pragma GCC diagnostic ignored \"-Wimplicit-function-declaration\"\n @@ -45,12 +45,10 @@ if (FILE_PARSE) #pragma warning(push, 1)\n #endif\n ") - file (APPEND ${FILE_PARSE} "${TEST_STREAM}") - message (STATUS "processing pragma in ${FILE_PARSE}") - execute_process ( - COMMAND ${CMAKE_COMMAND} -E touch ${FILE_PARSE}.timestamp - DEPENDS "${FILE_PARSE}" - ) + file (APPEND ${FILE_PARSE}.c "${TEST_STREAM}") + message (STATUS "processed pragma in ${FILE_PARSE}") + file (READ ${GEN_DIR}/${FILE_PARSE}.h TEST_STREAM) + file (WRITE ${FILE_PARSE}.h "${TEST_STREAM}") endif (FILE_PARSE) if (FILE_ANALYZE) @@ -58,7 +56,7 @@ if (FILE_ANALYZE) # # Note that the GCC pragmas did not exist until gcc 4.2. Earlier versions # will simply ignore them, but we want to avoid those warnings. - file (READ ${FILE_ANALYZE} TEST_STREAM) + file (READ ${GEN_DIR}/${FILE_ANALYZE} TEST_STREAM) file (WRITE ${FILE_ANALYZE} " #if __GNUC__ >= 4 && __GNUC_MINOR__ >=2\n #pragma GCC diagnostic ignored \"-Wconversion\"\n @@ -82,9 +80,5 @@ if (FILE_ANALYZE) #endif\n ") file (APPEND ${FILE_ANALYZE} "${TEST_STREAM}") - message (STATUS "processing pragma in ${FILE_ANALYZE}") - execute_process ( - COMMAND ${CMAKE_COMMAND} -E touch ${FILE_ANALYZE}.timestamp - DEPENDS "${FILE_ANALYZE}" - ) + message (STATUS "processed pragma in ${FILE_ANALYZE}") endif (FILE_ANALYZE) |