Ver código fonte

Merge pull request #1046 from open62541/hotfix/build_deps

Fix build dependencies
Stefan Profanter 7 anos atrás
pai
commit
be5af57869
3 arquivos alterados com 16 adições e 6 exclusões
  1. 6 1
      CMakeLists.txt
  2. 8 3
      appveyor.yml
  3. 2 2
      examples/CMakeLists.txt

+ 6 - 1
CMakeLists.txt

@@ -406,7 +406,7 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/open62541.c
                            ${OPEN62541_VER_COMMIT} ${CMAKE_CURRENT_BINARY_DIR}/open62541.c ${internal_headers} ${lib_sources}
                    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py ${internal_headers} ${lib_sources})
 
-ADD_CUSTOM_TARGET(open625451_amalgamation DEPENDS ${PROJECT_BINARY_DIR}/open62541.h
+ADD_CUSTOM_TARGET(open62541_amalgamation DEPENDS ${PROJECT_BINARY_DIR}/open62541.h
                                                   ${PROJECT_BINARY_DIR}/open62541.c)
 
 # example information model from nodeset xml
@@ -436,6 +436,11 @@ assign_source_group(${exported_headers})
 
 if(UA_ENABLE_AMALGAMATION)
     add_library(open62541-object OBJECT ${PROJECT_BINARY_DIR}/open62541.c ${PROJECT_BINARY_DIR}/open62541.h)
+
+    # make sure the open62541_amalgamation target builds before so that amalgamation is finished and it is not executed again for open62541-object 
+    # and thus may overwrite the amalgamation result during multiprocessor compilation
+    add_dependencies(open62541-object open62541_amalgamation)
+
     target_include_directories(open62541-object PRIVATE ${PROJECT_BINARY_DIR})
     if(UA_COMPILE_AS_CXX)
         set_source_files_properties(${PROJECT_BINARY_DIR}/open62541.c PROPERTIES LANGUAGE CXX)

+ 8 - 3
appveyor.yml

@@ -44,8 +44,7 @@ environment:
 
 cache:
   - '%CYG_CACHE%'
-  # Caching miktex is too big currently, so skip it
-  #- 'c:\miktex'
+  - 'c:\miktex'
   #- 'c:\python27'
 
 init:
@@ -63,6 +62,12 @@ install:
   # Install miktex to get pdflatex, if we don't get it from the cache
   - if not exist c:\miktex\texmfs\install\miktex\bin\pdflatex.exe appveyor DownloadFile http://mirrors.ctan.org/systems/win32/miktex/setup/miktex-portable.exe
   - if not exist c:\miktex\texmfs\install\miktex\bin\pdflatex.exe 7z x miktex-portable.exe -oc:\miktex >NUL
+  # Remove some big files to reduce size to be cached
+  - if exist c:\miktex\texmfs\install\doc rd /s /q c:\miktex\texmfs\install\doc
+  - if exist c:\miktex\texmfs\install\internal rd /s /q c:\miktex\texmfs\install\internal
+  - if exist c:\miktex\texmfs\install\miktex\bin\biber.exe rd /s /q c:\miktex\texmfs\install\miktex\bin\biber.exe
+  - if exist c:\miktex\texmfs\install\miktex\bin\icudt58.dll rd /s /q c:\miktex\texmfs\install\miktex\bin\icudt58.dll
+  - if exist c:\miktex\texmfs\install\miktex\bin\a5toa4.exe rd /s /q c:\miktex\texmfs\install\miktex\bin\a5toa4.exe
   - pip install --user sphinx sphinx_rtd_theme
 
 before_build:
@@ -140,4 +145,4 @@ build_script:
 
 after_build:
   - appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\open62541-%CC_SHORTNAME%-static.zip
-  - appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\open62541-%CC_SHORTNAME%-dynamic.zip
+  - appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\open62541-%CC_SHORTNAME%-dynamic.zip

+ 2 - 2
examples/CMakeLists.txt

@@ -40,7 +40,7 @@ macro(add_example EXAMPLE_NAME EXAMPLE_SOURCE)
   add_executable(${EXAMPLE_NAME} ${STATIC_OBJECTS} ${EXAMPLE_SOURCE})
   target_link_libraries(${EXAMPLE_NAME} ${LIBS})
   assign_source_group(${EXAMPLE_SOURCE})
-  add_dependencies(${EXAMPLE_NAME} open625451_amalgamation)
+  add_dependencies(${EXAMPLE_NAME} open62541_amalgamation)
   set_target_properties(${EXAMPLE_NAME} PROPERTIES FOLDER "open62541/examples")
   if(UA_COMPILE_AS_CXX)
     set_source_files_properties(${EXAMPLE_SOURCE} PROPERTIES LANGUAGE CXX)
@@ -126,4 +126,4 @@ if(UA_ENABLE_DISCOVERY)
     if(UA_ENABLE_DISCOVERY_MULTICAST)
         add_example(discovery_server_multicast discovery/server_multicast.c)
     endif()
-endif()
+endif()