Revision: 77881
http://sourceforge.net/p/brlcad/code/77881
Author: starseeker
Date: 2020-12-03 01:09:51 +0000 (Thu, 03 Dec 2020)
Log Message:
-----------
Skip adding the git commit into the version header.
Modified Paths:
--------------
brlcad/branches/extbuild/src/other/ext/stepcode/cmake/SC_Config_Headers.cmake
brlcad/branches/extbuild/src/other/ext/stepcode/src/exp2cxx/CMakeLists.txt
brlcad/branches/extbuild/src/other/ext/stepcode/src/exppp/CMakeLists.txt
brlcad/branches/extbuild/src/other/ext/stepcode/src/express/CMakeLists.txt
Added Paths:
-----------
brlcad/branches/extbuild/src/other/ext/stepcode/src/express/generated/CMakeLists.txt
Removed Paths:
-------------
brlcad/branches/extbuild/src/other/ext/stepcode/cmake/sc_version_string.cmake
Modified:
brlcad/branches/extbuild/src/other/ext/stepcode/cmake/SC_Config_Headers.cmake
===================================================================
---
brlcad/branches/extbuild/src/other/ext/stepcode/cmake/SC_Config_Headers.cmake
2020-12-02 21:30:01 UTC (rev 77880)
+++
brlcad/branches/extbuild/src/other/ext/stepcode/cmake/SC_Config_Headers.cmake
2020-12-03 01:09:51 UTC (rev 77881)
@@ -101,32 +101,17 @@
file(WRITE ${CONFIG_H_FILE} "${CONFIG_H_FILE_CONTENTS}")
configure_file(${CONFIG_H_FILE}
${SC_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_cf.h)
-# ------------------------
-
-# create sc_version_string.h, http://stackoverflow.com/questions/3780667
-# Using 'ver_string' instead of 'sc_version_string.h' is a trick to force the
-# command to always execute when the custom target is built. It works because
-# a file by that name never exists.
-if(SC_GIT_VERSION)
- configure_file(${SC_CMAKE_DIR}/sc_version_string.cmake
${SC_BINARY_DIR}/sc_version_string.cmake @ONLY)
- add_custom_target(version_string ALL DEPENDS ver_string)
- # creates sc_version_string.h using cmake script
- add_custom_command(OUTPUT ver_string
${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h
- COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${SC_SOURCE_DIR}
-DBINARY_DIR=${SC_BINARY_DIR} -P ${SC_BINARY_DIR}/sc_version_string.cmake
- )
- # sc_version_string.h is a generated file
-else(SC_GIT_VERSION)
- set(VER_HDR "
- #ifndef SC_VERSION_STRING
- #define SC_VERSION_STRING
- static char sc_version[512] = {\"${SC_VERSION}\"};
- #endif"
- )
- file(WRITE
${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h
"${VER_HDR}")
-endif(SC_GIT_VERSION)
+set(VER_HDR "
+#ifndef SC_VERSION_STRING
+#define SC_VERSION_STRING
+static char sc_version[512] = {\"${SC_VERSION}\"};
+#endif"
+)
+file(WRITE
${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h
"${VER_HDR}")
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h
PROPERTIES GENERATED TRUE
- HEADER_FILE_ONLY TRUE )
+ HEADER_FILE_ONLY TRUE
+ )
# Local Variables:
# tab-width: 8
Deleted:
brlcad/branches/extbuild/src/other/ext/stepcode/cmake/sc_version_string.cmake
===================================================================
---
brlcad/branches/extbuild/src/other/ext/stepcode/cmake/sc_version_string.cmake
2020-12-02 21:30:01 UTC (rev 77880)
+++
brlcad/branches/extbuild/src/other/ext/stepcode/cmake/sc_version_string.cmake
2020-12-03 01:09:51 UTC (rev 77881)
@@ -1,84 +0,0 @@
-# creates sc_version_string.h, which defines sc_version()
-# sc_version() returns a pretty commit description and a build timestamp.
-
-# only update the file if the git commit has changed, because whenever the
file is updated files including the header must rebuild
-# parallel rebuilds can result in race conditions and failures, particularly
when running ctest in parallel
-
-# http://stackoverflow.com/questions/3780667
-# http://www.cmake.org/pipermail/cmake/2009-February/027014.html
-
-set(SC_IS_SUBBUILD "@SC_IS_SUBBUILD@")
-set(SC_ENABLE_TESTING "@SC_ENABLE_TESTING@")
-
-set(SC_VERSION_HEADER "${BINARY_DIR}/include/sc_version_string.h")
-
-#---------- find commit id ------------------
-#use git for a pretty commit id
-#uses 'git describe --tags', so tags are required in the repo
-#create a tag with 'git tag <name>' and 'git push --tags'
-#if git can't be found, uses contents of SC_VERSION.txt
-
-set(VERS_FILE ${SOURCE_DIR}/SC_VERSION.txt)
-if(EXISTS ${SOURCE_DIR}/.git)
- find_package(Git QUIET)
- if(GIT_FOUND)
- execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags
WORKING_DIRECTORY ${SOURCE_DIR}
- RESULT_VARIABLE res_var OUTPUT_VARIABLE GIT_COMMIT_ID)
- if(NOT ${res_var} EQUAL 0)
- file(READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255)
- if(NOT SC_IS_SUBBUILD)
- message(WARNING "Git failed (probably no tags in repo). Build will
contain revision info from ${VERS_FILE}.")
- endif(NOT SC_IS_SUBBUILD)
- endif()
- else(GIT_FOUND)
- file(READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255)
- if(NOT SC_IS_SUBBUILD)
- message(WARNING "Git not found. Build will contain revision info from
${VERS_FILE}.")
- endif(NOT SC_IS_SUBBUILD)
- endif(GIT_FOUND)
-else()
- file(READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255)
- if(NOT SC_IS_SUBBUILD)
- message(WARNING "Git failed ('.git' not found). Build will contain
revision info from ${VERS_FILE}.")
- endif(NOT SC_IS_SUBBUILD)
-endif()
-string(REPLACE "\n" "" GIT_COMMIT_ID ${GIT_COMMIT_ID})
-
-#-------------- date and time ---------------
-
-if(SC_ENABLE_TESTING)
- set (date_time_string "NA - disabled for testing")
-else()
- string(TIMESTAMP date_time_string UTC)
-endif()
-
-set(header_string "/* sc_version_string.h - written by cmake. Changes will be
lost! */\n"
- "#ifndef SC_VERSION_STRING\n"
- "#define SC_VERSION_STRING\n\n"
- "/*\n** The git commit id looks like \"test-1-g5e1fb47\", where test is
the\n"
- "** name of the last tagged git revision, 1 is the number of commits since
that tag,\n"
- "** 'g' is unknown, and 5e1fb47 is the first 7 chars of the git sha1 commit
id.\n"
- "** timestamp is created from date/time commands on known platforms, and
uses\n"
- "** preprocessor macros elsewhere.\n*/\n\n"
- "static char sc_version[512] = {\n"
- " \"git commit id: ${GIT_COMMIT_ID}, build timestamp
${date_time_string}\"\n"
- "}\;\n\n"
- "#endif\n"
- )
-
-#don't update the file unless something changed
-string(RANDOM tmpsuffix)
-file(WRITE ${SC_VERSION_HEADER}.${tmpsuffix} ${header_string})
-execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
${SC_VERSION_HEADER}.${tmpsuffix} ${SC_VERSION_HEADER})
-execute_process(COMMAND ${CMAKE_COMMAND} -E remove
${SC_VERSION_HEADER}.${tmpsuffix})
-
-if(NOT SC_IS_SUBBUILD)
- message("-- sc_version_string.h is up-to-date.")
-endif(NOT SC_IS_SUBBUILD)
-
-# Local Variables:
-# tab-width: 8
-# mode: cmake
-# indent-tabs-mode: t
-# End:
-# ex: shiftwidth=2 tabstop=8
Modified:
brlcad/branches/extbuild/src/other/ext/stepcode/src/exp2cxx/CMakeLists.txt
===================================================================
--- brlcad/branches/extbuild/src/other/ext/stepcode/src/exp2cxx/CMakeLists.txt
2020-12-02 21:30:01 UTC (rev 77880)
+++ brlcad/branches/extbuild/src/other/ext/stepcode/src/exp2cxx/CMakeLists.txt
2020-12-03 01:09:51 UTC (rev 77881)
@@ -39,12 +39,6 @@
SC_ADDEXEC(exp2cxx SOURCES ${exp2cxx_SOURCES} LINK_LIBRARIES libexppp express
base)
-set_source_files_properties(
- classes_misc.c
- PROPERTIES OBJECT_DEPENDS
- "${SC_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h"
- )
-
if(NOT SC_IS_SUBBUILD AND SC_GIT_VERSION)
add_dependencies(exp2cxx version_string)
endif(NOT SC_IS_SUBBUILD AND SC_GIT_VERSION)
Modified:
brlcad/branches/extbuild/src/other/ext/stepcode/src/exppp/CMakeLists.txt
===================================================================
--- brlcad/branches/extbuild/src/other/ext/stepcode/src/exppp/CMakeLists.txt
2020-12-02 21:30:01 UTC (rev 77880)
+++ brlcad/branches/extbuild/src/other/ext/stepcode/src/exppp/CMakeLists.txt
2020-12-03 01:09:51 UTC (rev 77881)
@@ -18,12 +18,6 @@
pretty_where.c
)
-set_source_files_properties(
- pretty_schema.c
- PROPERTIES OBJECT_DEPENDS
- "${SC_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h"
- )
-
SET(EXPPP_SOURCES
../express/fedex.c
exppp-main.c
@@ -49,7 +43,6 @@
set_target_properties(libexppp-static PROPERTIES PREFIX "")
endif()
-
SC_ADDEXEC(exppp SOURCES ${EXPPP_SOURCES} LINK_LIBRARIES libexppp express base)
if(SC_ENABLE_TESTING)
Modified:
brlcad/branches/extbuild/src/other/ext/stepcode/src/express/CMakeLists.txt
===================================================================
--- brlcad/branches/extbuild/src/other/ext/stepcode/src/express/CMakeLists.txt
2020-12-02 21:30:01 UTC (rev 77880)
+++ brlcad/branches/extbuild/src/other/ext/stepcode/src/express/CMakeLists.txt
2020-12-03 01:09:51 UTC (rev 77881)
@@ -10,23 +10,19 @@
LEMON_TARGET(ExpParser expparse.y)
PERPLEX_TARGET(ExpScanner expscan.l)
ADD_PERPLEX_LEMON_DEPENDENCY(ExpScanner ExpParser)
- include_directories(
- ${LEMON_ExpParser_INCLUDE_DIR}
- ${PERPLEX_ExpScanner_INCLUDE_DIR}
- )
+
+ add_library(objlib_expscan_c OBJECT ${PERPLEX_ExpScanner_SRC})
+ set_property(TARGET objlib_expscan_c PROPERTY POSITION_INDEPENDENT_CODE ON)
+
+ add_library(objlib_expparse_c OBJECT ${LEMON_ExpParser_SRC})
+ set_property(TARGET objlib_expparse_c PROPERTY POSITION_INDEPENDENT_CODE ON)
+
else(SC_GENERATE_LP_SOURCES)
- set(LEMON_ExpParser_SRC ${CMAKE_CURRENT_SOURCE_DIR}/generated/expparse.c)
- set(LEMON_ExpParser_HDR ${CMAKE_CURRENT_SOURCE_DIR}/generated/expparse.h)
- set(PERPLEX_ExpScanner_SRC ${CMAKE_CURRENT_SOURCE_DIR}/generated/expscan.c)
- set(PERPLEX_ExpScanner_HDR ${CMAKE_CURRENT_SOURCE_DIR}/generated/expscan.h)
+ add_subdirectory(generated)
include_directories(generated)
endif(SC_GENERATE_LP_SOURCES)
set(EXPRESS_SOURCES
- ${LEMON_ExpParser_HDR}
- ${LEMON_ExpParser_SRC}
- ${PERPLEX_ExpScanner_HDR}
- ${PERPLEX_ExpScanner_SRC}
symbol.c
type.c
variable.c
@@ -51,55 +47,31 @@
ordered_attrs.cc
info.c
factory.c
- )
+ )
-set_source_files_properties(
- info.c fedex.c
- PROPERTIES OBJECT_DEPENDS
- "${SC_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h"
- )
+set(EXPRESS_OBJS)
+foreach(_src ${EXPRESS_SOURCES})
+ string(REPLACE "." "_" _suffix ${_src})
+ set(_objlib "objlib_${_suffix}")
+ add_library(${_objlib} OBJECT ${_src})
+ # TODO: probably PIC should be used everywhere...
+ set_property(TARGET ${_objlib} PROPERTY POSITION_INDEPENDENT_CODE ON)
+ list(APPEND EXPRESS_OBJS $<TARGET_OBJECTS:${_objlib}>)
+endforeach()
-add_library(express-obj OBJECT ${EXPRESS_SOURCES})
-add_dependencies(express-obj base)
-if(MSVC)
- set_property(TARGET express-obj APPEND PROPERTY COMPILE_DEFINITIONS
"SC_EXPRESS_DLL_EXPORTS")
-endif(MSVC)
+list(APPEND EXPRESS_OBJS $<TARGET_OBJECTS:objlib_expscan_c>)
+list(APPEND EXPRESS_OBJS $<TARGET_OBJECTS:objlib_expparse_c>)
-add_library(express SHARED ${EXPRESS_SOURCES})
-target_link_libraries(express base)
-if(OPENBSD)
- set_target_properties(express PROPERTIES VERSION
${SC_VERSION_MAJOR}.${SC_VERSION_MINOR})
-else(OPENBSD)
- set_target_properties(express PROPERTIES VERSION ${SC_VERSION} SOVERSION
${SC_VERSION_MAJOR})
-endif(OPENBSD)
-if(APPLE)
- set_property(TARGET express APPEND PROPERTY LINK_FLAGS "-flat_namespace
-undefined suppress")
-endif(APPLE)
-install(TARGETS express
- RUNTIME DESTINATION ${BIN_DIR}
- LIBRARY DESTINATION ${LIB_DIR}
- ARCHIVE DESTINATION ${LIB_DIR})
+if(SC_GENERATE_LP_SOURCES)
+ set_property(TARGET objlib_expparse_c objlib_express_c objlib_lexact_c
+ APPEND PROPERTY INCLUDE_DIRECTORIES
"${PERPLEX_ExpScanner_INCLUDE_DIR}")
+ set_property(TARGET objlib_expscan_c objlib_express_c objlib_lexact_c
+ APPEND PROPERTY INCLUDE_DIRECTORIES
"${LEMON_ExpParser_INCLUDE_DIR}")
+ # OBJECT libraries are not targets, and so an explicit dependency is required
+ set_source_files_properties(express.c lexact.c PROPERTIES OBJECT_DEPENDS
"${PERPLEX_ExpScanner_HDR};${LEMON_ExpParser_HDR}")
+endif()
-if(TARGET version_string)
- add_dependencies(express version_string)
-endif(TARGET version_string)
-if(MSVC)
- set_property(TARGET express APPEND PROPERTY COMPILE_DEFINITIONS
"SC_EXPRESS_DLL_EXPORTS")
- set_property(TARGET express APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS
"SC_EXPRESS_DLL_IMPORTS")
-endif(MSVC)
-
-if (BUILD_STATIC_LIBS)
- add_library(express-static STATIC ${EXPRESS_SOURCES})
- if(TARGET version_string)
- add_dependencies(express-static version_string)
- endif(TARGET version_string)
- install(TARGETS express-static
- RUNTIME DESTINATION ${BIN_DIR}
- LIBRARY DESTINATION ${LIB_DIR}
- ARCHIVE DESTINATION ${LIB_DIR})
-endif (BUILD_STATIC_LIBS)
-
# TODO
# Currently, fedex.c provides the main() for multiple programs. These programs
# provide custom behavior by defining EXPRESSinit_init (called by fedex.c's
@@ -113,9 +85,36 @@
fedex.c
inithook.c
)
-add_executable(check-express ${CHECK_EXPRESS_SOURCES})
-target_link_libraries(check-express express base)
+SET(EXPRESS_PRIVATE_HDRS
+ exptoks.h
+ stack.h
+ )
+
+variable_watch(SC_ADDLIB_EXPRESS_ARG_LINK_LIBRARIES)
+variable_watch(SC_ADDLIB_EXPRESS-STATIC_ARG_LINK_LIBRARIES)
+
+if($CACHE{SC_BUILD_SHARED_LIBS})
+ SC_ADDLIB(express SHARED SOURCES "dummy.c" ${EXPRESS_OBJS} LINK_LIBRARIES
base)
+ if(WIN32)
+ target_compile_definitions(express PRIVATE SC_EXPRESS_DLL_EXPORTS)
+ endif()
+
+ if(NOT SC_IS_SUBBUILD AND SC_GIT_VERSION)
+ add_dependencies(express version_string)
+ endif()
+endif()
+
+if($CACHE{SC_BUILD_STATIC_LIBS})
+ SC_ADDLIB(express-static STATIC SOURCES "dummy.c" ${EXPRESS_OBJS}
LINK_LIBRARIES base-static)
+
+ if(NOT SC_IS_SUBBUILD AND SC_GIT_VERSION)
+ add_dependencies(express-static version_string)
+ endif()
+endif()
+
+SC_ADDEXEC(check-express SOURCES ${CHECK_EXPRESS_SOURCES} LINK_LIBRARIES
express base ${SC_EXEC_NOINSTALL})
+
if(SC_ENABLE_TESTING)
add_subdirectory(test)
endif(SC_ENABLE_TESTING)
Added:
brlcad/branches/extbuild/src/other/ext/stepcode/src/express/generated/CMakeLists.txt
===================================================================
---
brlcad/branches/extbuild/src/other/ext/stepcode/src/express/generated/CMakeLists.txt
(rev 0)
+++
brlcad/branches/extbuild/src/other/ext/stepcode/src/express/generated/CMakeLists.txt
2020-12-03 01:09:51 UTC (rev 77881)
@@ -0,0 +1,8 @@
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+
+add_library(objlib_expscan_c OBJECT expscan.c)
+set_property(TARGET objlib_expscan_c PROPERTY POSITION_INDEPENDENT_CODE ON)
+
+add_library(objlib_expparse_c OBJECT expparse.c)
+set_property(TARGET objlib_expparse_c PROPERTY POSITION_INDEPENDENT_CODE ON)
+
Property changes on:
brlcad/branches/extbuild/src/other/ext/stepcode/src/express/generated/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits