Prechádzať zdrojové kódy

Merge pull request #1153 from open62541/hotfix/appveyor_ci

WIP: Fix build error on AppVeyor for VS2008 and cleanup appveyor
Stefan Profanter 7 rokov pred
rodič
commit
1d9ae45574
3 zmenil súbory, kde vykonal 22 pridanie a 19 odobranie
  1. 13 10
      CMakeLists.txt
  2. 8 8
      appveyor.yml
  3. 1 1
      examples/CMakeLists.txt

+ 13 - 10
CMakeLists.txt

@@ -443,11 +443,11 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/open62541.c
                            ${internal_headers} ${lib_sources} ${default_plugin_sources}
                    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tools/amalgamate.py ${internal_headers} ${lib_sources})
 
-add_custom_target(open62541_amalgamation_source DEPENDS ${PROJECT_BINARY_DIR}/open62541.c)
-add_custom_target(open62541_amalgamation_header DEPENDS ${PROJECT_BINARY_DIR}/open62541.h)
+add_custom_target(open62541-amalgamation-source DEPENDS ${PROJECT_BINARY_DIR}/open62541.c)
+add_custom_target(open62541-amalgamation-header DEPENDS ${PROJECT_BINARY_DIR}/open62541.h)
 
-add_dependencies(open62541_amalgamation_source open62541-generator-types open62541-generator-transport open62541-generator-statuscode)
-add_dependencies(open62541_amalgamation_header open62541-generator-types)
+add_dependencies(open62541-amalgamation-source open62541-generator-types open62541-generator-transport open62541-generator-statuscode)
+add_dependencies(open62541-amalgamation-header open62541-generator-types)
 
 # generated namespace 0
 add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/src_generated/ua_namespaceinit_generated.c
@@ -485,7 +485,9 @@ if(UA_ENABLE_AMALGAMATION)
     # 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
     # the header is already a dependency of open62541 target itself
-    add_dependencies(open62541-object open62541_amalgamation_source)
+    add_dependencies(open62541-object
+            open62541-amalgamation-header
+            open62541-amalgamation-source)
 
     add_library(open62541 $<TARGET_OBJECTS:open62541-object>)
 
@@ -495,7 +497,11 @@ if(UA_ENABLE_AMALGAMATION)
 else()
     add_definitions(-DUA_NO_AMALGAMATION)
     add_library(open62541-object OBJECT ${lib_sources} ${internal_headers} ${exported_headers})
-    add_dependencies(open62541-object open62541-generator-types open62541-generator-transport open62541-generator-statuscode)
+    add_dependencies(open62541-object
+            open62541-amalgamation-header
+            open62541-generator-types
+            open62541-generator-transport
+            open62541-generator-statuscode)
     target_include_directories(open62541-object PRIVATE ${PROJECT_SOURCE_DIR}/src)
 
     add_library(open62541-plugins OBJECT ${default_plugin_sources} ${exported_headers})
@@ -513,7 +519,7 @@ else()
 endif()
 
 if(UA_ENABLE_GENERATE_NAMESPACE0)
-    add_dependencies(open62541_amalgamation_source open62541-generator-namespace)
+    add_dependencies(open62541-amalgamation-source open62541-generator-namespace)
     if(NOT UA_ENABLE_AMALGAMATION)
         add_dependencies(open62541-object open62541-generator-namespace)
     endif()
@@ -530,9 +536,6 @@ endif()
 # DLL requires linking to dependencies
 target_link_libraries(open62541 ${open62541_LIBRARIES})
 
-# Always generate the amalgamated header
-add_dependencies(open62541 open62541_amalgamation_header)
-
 # Generate properly versioned shared library links on Linux
 SET_TARGET_PROPERTIES(open62541 PROPERTIES SOVERSION 0 VERSION "${OPEN62541_VER_MAJOR}.${OPEN62541_VER_MINOR}.${OPEN62541_VER_PATCH}")
 

+ 8 - 8
appveyor.yml

@@ -16,28 +16,28 @@ environment:
     matrix:
         - CC_NAME: MinGW Makefiles
           CC_SHORTNAME: mingw
-          MAKE: mingw32-make
+          MAKE: mingw32-make -j
           FORCE_CXX: OFF
           OUT_DIR_LIB: bin
           OUT_DIR_EXAMPLES: bin\examples
         - CC_NAME: Visual Studio 9 2008
           CC_SHORTNAME: vs2008
           # Do not build in parallel, project dependencies are not solved correctly and thus appveyor may randomly fail
-          MAKE: msbuild /m:1 /p:BuildInParallel=false open62541.sln
+          MAKE: msbuild /m:1 /p:BuildInParallel=false /p:ContinueOnError=false /p:StopOnFirstFailure=true open62541.sln
           FORCE_CXX: ON
           OUT_DIR_LIB: bin\Debug
           OUT_DIR_EXAMPLES: bin\examples\Debug
         - CC_NAME: Visual Studio 12 2013
           CC_SHORTNAME: vs2013
           # Do not build in parallel, project dependencies are not solved correctly and thus appveyor may randomly fail
-          MAKE: msbuild /m:1 /p:BuildInParallel=false open62541.sln
+          MAKE: msbuild /m:1 /p:BuildInParallel=false /p:ContinueOnError=false /p:StopOnFirstFailure=true open62541.sln
           FORCE_CXX: OFF
           OUT_DIR_LIB: bin\Debug
           OUT_DIR_EXAMPLES: bin\examples\Debug
         - CC_NAME: Visual Studio 12 2013 Win64
           CC_SHORTNAME: vs2013-x64
           # Do not build in parallel, project dependencies are not solved correctly and thus appveyor may randomly fail
-          MAKE: msbuild /m:1 /p:BuildInParallel=false open62541.sln
+          MAKE: msbuild /m:1 /p:BuildInParallel=false /p:ContinueOnError=false /p:StopOnFirstFailure=true open62541.sln
           FORCE_CXX: OFF
           OUT_DIR_LIB: bin\Debug
           OUT_DIR_EXAMPLES: bin\examples\Debug
@@ -95,7 +95,7 @@ build_script:
   # now start build
   - md build
   - cd build
-  - echo "Building Documentation on %CC_NAME%"
+  - echo. && echo "##### Building Documentation on %CC_NAME% #####" && echo.
   - cmake -DMIKTEX_BINARY_PATH=c:\miktex\texmfs\install\miktex\bin -DCMAKE_BUILD_TYPE=Release -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -DUA_BUILD_EXAMPLES:BOOL=OFF -G"%CC_NAME%" ..
   - cmake --build . --target doc_latex & cmake --build . --target doc_pdf
   - move "%APPVEYOR_BUILD_FOLDER%\build\doc_latex\open62541.pdf" %APPVEYOR_BUILD_FOLDER%\pack\
@@ -103,14 +103,14 @@ build_script:
   - rd /s /q build
   - md build
   - cd build
-  - echo "Testing %CC_NAME%"
+  - echo. && echo "##### Testing %CC_NAME% #####" && echo.
   - cmake -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -G"%CC_NAME%" ..
   - '%MAKE%'
   - cd ..
   - rd /s /q build
   - md build
   - cd build
-  - echo "Testing %CC_NAME% with amalgamation"
+  - echo. && echo "##### Testing %CC_NAME% with amalgamation #####" && echo.
   - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -DBUILD_SHARED_LIBS:BOOL=OFF -G"%CC_NAME%" ..
   - '%MAKE%'
   - md %APPVEYOR_BUILD_FOLDER%\pack_tmp
@@ -126,7 +126,7 @@ build_script:
   - rd /s /q build
   - md build
   - cd build
-  - echo "Testing %CC_NAME% with amalgamation and .dll"
+  - echo. && echo "##### Testing %CC_NAME% with amalgamation and .dll #####" && echo.
   - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -DBUILD_SHARED_LIBS:BOOL=ON -G"%CC_NAME%" ..
   - '%MAKE%'
   - md %APPVEYOR_BUILD_FOLDER%\pack_tmp

+ 1 - 1
examples/CMakeLists.txt

@@ -12,7 +12,7 @@ macro(add_example EXAMPLE_NAME EXAMPLE_SOURCE)
   add_executable(${EXAMPLE_NAME} ${STATIC_OBJECTS} ${EXAMPLE_SOURCE} ${ARGN})
   target_link_libraries(${EXAMPLE_NAME} open62541 ${open62541_LIBRARIES})
   assign_source_group(${EXAMPLE_SOURCE})
-  add_dependencies(${EXAMPLE_NAME} open62541_amalgamation_header open62541_amalgamation_source)
+  add_dependencies(${EXAMPLE_NAME} open62541-amalgamation-header open62541-amalgamation-source)
   set_target_properties(${EXAMPLE_NAME} PROPERTIES FOLDER "open62541/examples")
   if(UA_COMPILE_AS_CXX)
     set_source_files_properties(${EXAMPLE_SOURCE} PROPERTIES LANGUAGE CXX)