2019-08-21 22:51 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0004733Spring enginepublic2017-06-10 14:32
ReporterUnitedMarsupials 
Assigned TojK 
PrioritynormalSeverityfeatureReproducibilityalways
StatusassignedResolutionopen 
Product Version98.0 
Target VersionFixed in Version 
Summary0004733: remove include/* from spring repo
DescriptionTrying to compile rts/lib/headlessStubs/sdlstub.c without the top-level include/SDL subdirectory present causes an error:

/home/ports/games/spring/work/spring_98.0/rts/lib/headlessStubs/sdlstub.c:8:10: fatal error: 'SDL.h' file not found
#include <SDL.h>
         ^
1 error generated.
Additional InformationFor some reason, the system's location of SDL.h is not added to the compiler's include-path. (Interestingly, glstub.c does not have this problem...)
TagsNo tags attached.
Checked infolog.txt for lua Errors
Attached Files
  • txt file icon spring-cmake-dot.txt (11,950 bytes) 2015-04-08 21:53 -
    CMake Warning at CMakeLists.txt:52 (Message):
      Using custom C_FLAGS: -O2 -pipe -march=core2 -fstack-protector
      -fno-strict-aliasing this build will very likely not sync in online mode!
    
    
    CMake Warning at CMakeLists.txt:56 (Message):
      Using custom CXX_FLAGS: -O2 -pipe -march=core2 -fstack-protector
      -fno-strict-aliasing -Wno-deprecated -std=c++11 this build will very likely
      not sync in online mode!
    
    
    -- Boost version: 1.55.0
    -- Found the following Boost libraries:
    --   thread
    --   regex
    --   program_options
    --   system
    --   chrono
    --   signals
    --   filesystem
    -- Boost version: 1.55.0
    -- Found the following Boost libraries:
    --   timer
    -- Found SDL2: /opt/lib/libSDL2main.a;/opt/lib/libSDL2.so;-pthread  
    compiler doesn't support: -mno-lwp
    CMake Warning at rts/build/cmake/TestCXXFlags.cmake:79 (Message):
      Clang detected, disabled IEEE-FP
    Call Stack (most recent call first):
      CMakeLists.txt:305 (INCLUDE)
    
    
    -- Building Spring for 64bit environment
    CMake Warning at CMakeLists.txt:334 (Message):
      You are using ld.bfd, it's much slower than ld.gold.
    
    
    -- Compiling with C++11
    CMake Warning at CMakeLists.txt:403 (Message):
      unknown compiler
    
    
    -- Found SDL2: /opt/lib/libSDL2main.a;/opt/lib/libSDL2main.a;/opt/lib/libSDL2.so;-pthread;-pthread  
    -- Building Assimp with flags -O2 -pipe -march=core2 -fstack-protector -fno-strict-aliasing  -Wno-deprecated -std=c++11             -std=c++11  -pipe -fno-strict-aliasing  -fvisibility=hidden  -fvisibility-inlines-hidden -pthread
    -- Found AI Wrapper: CUtils (sources only wrapper)
    warning: Java AI Interface will not be built!
    -- Found AI Interface: C-AIInterface 0.1
    -- Found AI Wrapper: LegacyCpp-AIWrapper
    -- Found AI Wrapper: LegacyCpp-Creg-AIWrapper
    warning: Java OO AI Wrapper will not be built!
    -- Found AI Wrapper: Cpp-AIWrapper
    -- Found Skirmish AI: CppTestAI 0.1
    -- Found Skirmish AI: NullAI 0.1
    warning: NullOOJavaAI Skirmish AI will not be built!
    -- Found Skirmish AI: E323AI 3.25.0
    -- Found Skirmish AI: KAIK 0.13
    -- Found Skirmish AI: AAI 0.9
    warning: NullJavaAI Skirmish AI will not be built!
    -- Found Skirmish AI: Shard dev
    warning: HughAI Skirmish AI will not be built!
    -- Found Skirmish AI: RAI 0.601
    -- Command "/opt/bin/git;describe;--tags;--always;--candidates;999;--match;*" in directory /usr/ports/games/spring/work/spring_98.0/tools/pr-downloader/src failed with output:
    "fatal: Not a git repository (or any parent up to mount point /home)
    Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set)."
    -- Version tarball
    -- libminizip was not found, using integrated
    -- Boost version: 1.55.0
    -- Found the following Boost libraries:
    --   unit_test_framework
    -- MAN pages will be installed to {INSTALL_PREFIX}/man/man6
    -- /usr/ports/games/spring/work/spring_98.0/springsettings.cfg already exists!
    -- Using tcmalloc
    CMake Warning (dev) at rts/Sim/CMakeLists.txt:168 (get_property):
      Policy CMP0026 is not set: Disallow use of the LOCATION target property.
      Run "cmake --help-policy CMP0026" for policy details.  Use the cmake_policy
      command to set the policy and suppress this warning.
    
      The LOCATION property should not be read from target "engineSim".  Use the
      target name directly with add_custom_command, or use the generator
      expression $<TARGET_FILE>, as appropriate.
    
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    -- Using legacy as default engine
    -- Boost version: 1.55.0
    -- Found the following Boost libraries:
    --   unit_test_framework
    -- Configuring done
    CMake Warning (dev) at rts/builds/CMakeLists.txt:41 (add_dependencies):
      Policy CMP0046 is not set: Error on non-existent dependency in
      add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
      Use the cmake_policy command to set the policy and suppress this warning.
    
      The dependency target "HughAI" of target "spring-legacy" does not exist.
    Call Stack (most recent call first):
      rts/builds/legacy/CMakeLists.txt:95 (CreateEngineBuildAndInstallTarget)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at rts/builds/CMakeLists.txt:41 (add_dependencies):
      Policy CMP0046 is not set: Error on non-existent dependency in
      add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
      Use the cmake_policy command to set the policy and suppress this warning.
    
      The dependency target "Java-AIInterface" of target "spring-legacy" does not
      exist.
    Call Stack (most recent call first):
      rts/builds/legacy/CMakeLists.txt:95 (CreateEngineBuildAndInstallTarget)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at rts/builds/CMakeLists.txt:41 (add_dependencies):
      Policy CMP0046 is not set: Error on non-existent dependency in
      add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
      Use the cmake_policy command to set the policy and suppress this warning.
    
      The dependency target "JavaOO-AIWrapper" of target "spring-legacy" does not
      exist.
    Call Stack (most recent call first):
      rts/builds/legacy/CMakeLists.txt:95 (CreateEngineBuildAndInstallTarget)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at rts/builds/CMakeLists.txt:41 (add_dependencies):
      Policy CMP0046 is not set: Error on non-existent dependency in
      add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
      Use the cmake_policy command to set the policy and suppress this warning.
    
      The dependency target "NullJavaAI" of target "spring-legacy" does not
      exist.
    Call Stack (most recent call first):
      rts/builds/legacy/CMakeLists.txt:95 (CreateEngineBuildAndInstallTarget)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at rts/builds/CMakeLists.txt:41 (add_dependencies):
      Policy CMP0046 is not set: Error on non-existent dependency in
      add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
      Use the cmake_policy command to set the policy and suppress this warning.
    
      The dependency target "NullOOJavaAI" of target "spring-legacy" does not
      exist.
    Call Stack (most recent call first):
      rts/builds/legacy/CMakeLists.txt:95 (CreateEngineBuildAndInstallTarget)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at rts/builds/CMakeLists.txt:41 (add_dependencies):
      Policy CMP0046 is not set: Error on non-existent dependency in
      add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
      Use the cmake_policy command to set the policy and suppress this warning.
    
      The dependency target "HughAI" of target "spring-dedicated" does not exist.
    Call Stack (most recent call first):
      rts/builds/dedicated/CMakeLists.txt:163 (CreateEngineBuildAndInstallTarget)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at rts/builds/CMakeLists.txt:41 (add_dependencies):
      Policy CMP0046 is not set: Error on non-existent dependency in
      add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
      Use the cmake_policy command to set the policy and suppress this warning.
    
      The dependency target "Java-AIInterface" of target "spring-dedicated" does
      not exist.
    Call Stack (most recent call first):
      rts/builds/dedicated/CMakeLists.txt:163 (CreateEngineBuildAndInstallTarget)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at rts/builds/CMakeLists.txt:41 (add_dependencies):
      Policy CMP0046 is not set: Error on non-existent dependency in
      add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
      Use the cmake_policy command to set the policy and suppress this warning.
    
      The dependency target "JavaOO-AIWrapper" of target "spring-dedicated" does
      not exist.
    Call Stack (most recent call first):
      rts/builds/dedicated/CMakeLists.txt:163 (CreateEngineBuildAndInstallTarget)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at rts/builds/CMakeLists.txt:41 (add_dependencies):
      Policy CMP0046 is not set: Error on non-existent dependency in
      add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
      Use the cmake_policy command to set the policy and suppress this warning.
    
      The dependency target "NullJavaAI" of target "spring-dedicated" does not
      exist.
    Call Stack (most recent call first):
      rts/builds/dedicated/CMakeLists.txt:163 (CreateEngineBuildAndInstallTarget)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at rts/builds/CMakeLists.txt:41 (add_dependencies):
      Policy CMP0046 is not set: Error on non-existent dependency in
      add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
      Use the cmake_policy command to set the policy and suppress this warning.
    
      The dependency target "NullOOJavaAI" of target "spring-dedicated" does not
      exist.
    Call Stack (most recent call first):
      rts/builds/dedicated/CMakeLists.txt:163 (CreateEngineBuildAndInstallTarget)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at rts/builds/CMakeLists.txt:41 (add_dependencies):
      Policy CMP0046 is not set: Error on non-existent dependency in
      add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
      Use the cmake_policy command to set the policy and suppress this warning.
    
      The dependency target "HughAI" of target "spring-headless" does not exist.
    Call Stack (most recent call first):
      rts/builds/headless/CMakeLists.txt:64 (CreateEngineBuildAndInstallTarget)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at rts/builds/CMakeLists.txt:41 (add_dependencies):
      Policy CMP0046 is not set: Error on non-existent dependency in
      add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
      Use the cmake_policy command to set the policy and suppress this warning.
    
      The dependency target "Java-AIInterface" of target "spring-headless" does
      not exist.
    Call Stack (most recent call first):
      rts/builds/headless/CMakeLists.txt:64 (CreateEngineBuildAndInstallTarget)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at rts/builds/CMakeLists.txt:41 (add_dependencies):
      Policy CMP0046 is not set: Error on non-existent dependency in
      add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
      Use the cmake_policy command to set the policy and suppress this warning.
    
      The dependency target "JavaOO-AIWrapper" of target "spring-headless" does
      not exist.
    Call Stack (most recent call first):
      rts/builds/headless/CMakeLists.txt:64 (CreateEngineBuildAndInstallTarget)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at rts/builds/CMakeLists.txt:41 (add_dependencies):
      Policy CMP0046 is not set: Error on non-existent dependency in
      add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
      Use the cmake_policy command to set the policy and suppress this warning.
    
      The dependency target "NullJavaAI" of target "spring-headless" does not
      exist.
    Call Stack (most recent call first):
      rts/builds/headless/CMakeLists.txt:64 (CreateEngineBuildAndInstallTarget)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    CMake Warning (dev) at rts/builds/CMakeLists.txt:41 (add_dependencies):
      Policy CMP0046 is not set: Error on non-existent dependency in
      add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
      Use the cmake_policy command to set the policy and suppress this warning.
    
      The dependency target "NullOOJavaAI" of target "spring-headless" does not
      exist.
    Call Stack (most recent call first):
      rts/builds/headless/CMakeLists.txt:64 (CreateEngineBuildAndInstallTarget)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    -- Generating done
    -- Build files have been written to: /usr/ports/games/spring/work/spring_98.0
    
    txt file icon spring-cmake-dot.txt (11,950 bytes) 2015-04-08 21:53 +
  • ? file icon patch-use-system-sdl (3,457 bytes) 2015-04-09 01:36 -
    --- rts/builds/dedicated/CMakeLists.txt	2014-10-07 16:09:51.000000000 -0400
    +++ rts/builds/dedicated/CMakeLists.txt	2015-04-08 15:27:03.000000000 -0400
    @@ -43,19 +43,6 @@
     ENDIF (UNIX AND NOT MINGW)
     
    -IF    (MINGW OR APPLE)
    -	# Windows:
    -	# We still need these header files,
    -	# even if we are not going to link with SDL.
    -	# We have them available anyway (mingwlibs).
    -	# OS X:
    -	# Cocoa requires the SDL libary, whenever the SDL headers are used,
    -	# due to some #define magic, which is practically impossible to workaround.
    -	FIND_PACKAGE(SDL2 REQUIRED)
    -	INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR})
    -ELSE  (MINGW OR APPLE)
    -	# Use a direct copy of the GL and SDL headers,
    -	# as these may not be available on headless systems.
    -	INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/SDL2)
    -ENDIF (MINGW OR APPLE)
    +FIND_PACKAGE(SDL2 REQUIRED)
    +INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR})
     
     
    --- rts/builds/headless/CMakeLists.txt	2014-10-07 16:09:51.000000000 -0400
    +++ rts/builds/headless/CMakeLists.txt	2015-04-08 16:31:25.000000000 -0400
    @@ -14,22 +14,7 @@
     
     include_directories(${OPENAL_INCLUDE_DIR})
    -IF    (MINGW OR APPLE)
    -	# Windows:
    -	# We still need these header files,
    -	# even if we are not going to link with gl, glu and SDL.
    -	# We have them available anyway (mingwlibs).
    -	# OS X:
    -	# Cocoa requires the SDL libary, whenever the SDL headers are used,
    -	# due to some #define magic, which is practically impossible to workaround.
    -	FIND_PACKAGE(OpenGL REQUIRED)
    -	FIND_PACKAGE(SDL2 REQUIRED)
    -	INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR})
    -ELSE  (MINGW OR APPLE)
    -	# Use a direct copy of the GL and SDL headers,
    -	# as these may not be available on headless systems.
    -	INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
    -	INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/SDL2)
    -ENDIF (MINGW OR APPLE)
     
    +FIND_PACKAGE(SDL2 REQUIRED)
    +INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR})
     
     # headlessstubs are our stubs that replace libGL, libGLU, libGLEW, libSDL (yes really!)
    --- rts/lib/headlessStubs/CMakeLists.txt	2014-10-07 16:09:52.000000000 -0400
    +++ rts/lib/headlessStubs/CMakeLists.txt	2015-04-08 14:40:20.000000000 -0400
    @@ -7,16 +7,6 @@
     	)
     
    -IF    (WIN32)
    -	# We still need these header files,
    -	# even if we are not going to link with SDL.
    -	# We have them available anyway (mingwlibs).
    -	FIND_PACKAGE(SDL2 REQUIRED)
    -	INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR})
    -ELSE  (WIN32)
    -	# Use a direct copy of the GL and SDL headers,
    -	# as these may not be available on headless systems.
    -	INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/include)
    -	INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/include/SDL2)
    -ENDIF (WIN32)
    +FIND_PACKAGE(SDL2 REQUIRED)
    +INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR})
     
     ADD_LIBRARY(headlessStubs STATIC EXCLUDE_FROM_ALL ${headlessStubsSources})
    --- tools/unitsync/CMakeLists.txt	2014-10-07 16:09:52.000000000 -0400
    +++ tools/unitsync/CMakeLists.txt	2015-04-08 16:10:11.000000000 -0400
    @@ -22,16 +22,6 @@
     ENDIF (WIN32)
     
    -IF    (MINGW)
    -	# We still need these header files,
    -	# even if we are not going to link with SDL.
    -	# We have them available anyway (mingwlibs).
    -	FIND_PACKAGE(SDL2 REQUIRED)
    -	INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR})
    -ELSE  (MINGW)
    -	# Use a direct copy of the GL and SDL headers,
    -	# as these may not be available on headless systems.
    -	INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/SDL2)
    -ENDIF (MINGW)
    -
    +FIND_PACKAGE(SDL2 REQUIRED)
    +INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR})
     
     ADD_DEFINITIONS(-DUNITSYNC)
    
    ? file icon patch-use-system-sdl (3,457 bytes) 2015-04-09 01:36 +

-Relationships
has duplicate 0004731closedabma headlessStubs/glstub.c out of sync with the lastest GL/glext.h 
related to 0005033resolvedjK Dedicated / headless builds still need glu.h 
related to 0005611resolvedKloot wrong vram reported 
+Relationships

-Notes

~0014292

abma (administrator)

Last edited: 2015-04-08 20:47

View 2 revisions

because only sdlstub.c includes SDL.h?

we don't want to include system SDL.h because spring uses its own implementation for spring-headless.

whats the full path of system SDL.h?

~0014293

UnitedMarsupials (reporter)

Last edited: 2015-04-08 20:50

View 2 revisions

> we don't want to include system SDL.h because spring
> uses its own implementation for spring-headless.

Well, the implementation (definitions) can still be spring's own, but the declarations must be the same as the real SDL is using, or bad things are likely to happen...

> whats the full path of system SDL.h?

cmake is able to find it at configure-time -- and the headlessStubs/CMakeLists.txt is using it even:

FIND_PACKAGE(SDL2 REQUIRED)
INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIR})

but only in case of WIN32, for some reason, rather than always...

~0014295

abma (administrator)

for some reason we support spring-headless beeing built without SDL installed. on windows mingwlibs are used https://github.com/spring/mingwlibs which contains SDL2.h, i guess thats why this exception exists.

~0014298

UnitedMarsupials (reporter)

Here is another piece caught trying to use the bundled header-file:
/home/ports/games/spring/work/spring_98.0/rts/System/Platform/Linux/CrashHandler.cpp:19:10: fatal error: 'SDL_events.h' file not found
#include <SDL_events.h>
         ^
1 error generated.

Unlike headless stubs -- which should not even be necessary -- this has the real danger of getting out of sync with SDL2 causing bad things...

~0014299

UnitedMarsupials (reporter)

And another:

/home/ports/games/spring/work/spring_98.0/rts/Rendering/Textures/Bitmap.cpp:9:10: fatal error: 'SDL_video.h' file not found
#include <SDL_video.h>
         ^

~0014300

abma (administrator)

these files exist:
https://github.com/spring/spring/tree/develop/include/SDL2

are you compiling spring or spring-headless?

~0014301

abma (administrator)

Last edited: 2015-04-08 21:46

View 4 revisions

> whats the full path of system SDL.h?

that question is unanswered.

also whats the full output of a clean "cmake ." ?

for me it looks like you did something wrong at configure time or you hit some bug in springs CMakeLists.txt.

~0014302

UnitedMarsupials (reporter)

> these files exist

Yes, they exist. But if Spring's own copies of the headers are used, there may be a discrepancy between what the header advertises and what the library offers. For this reason -- unless compiling headless -- the bundled headers should not be used. I had them removed here deliberately to catch these errors.

> are you compiling spring or spring-headless?

spring (I think). Here is the full list of cmake-arguments used here:

-DDATADIR:STRING="share/spring" -DAI_TYPES:STRING="NATIVE" -DDOCDIR:STRING="share/doc/spring" -DCREATE_MAN_PAGES:BOOL=false -DUNITSYNC_PYTHON_WRAPPER:BOOL=false -DCUSTOM_CFLAGS:BOOL=true -DCREATE_MAN_PAGES:BOOL=true -DMANDIR:STRING="man" -DCMAKE_C_COMPILER:STRING="cc" -DCMAKE_CXX_COMPILER:STRING="c++" -DCMAKE_C_FLAGS:STRING="-O2 -pipe -march=core2 -fstack-protector -fno-strict-aliasing" -DCMAKE_C_FLAGS_DEBUG:STRING="-O2 -pipe -march=core2 -fstack-protector -fno-strict-aliasing" -DCMAKE_C_FLAGS_RELEASE:STRING="-O2 -pipe -march=core2 -fstack-protector -fno-strict-aliasing" -DCMAKE_CXX_FLAGS:STRING="-O2 -pipe -march=core2 -fstack-protector -fno-strict-aliasing -Wno-deprecated -std=c++11" -DCMAKE_CXX_FLAGS_DEBUG:STRING="-O2 -pipe -march=core2 -fstack-protector -fno-strict-aliasing -Wno-deprecated -std=c++11" -DCMAKE_CXX_FLAGS_RELEASE:STRING="-O2 -pipe -march=core2 -fstack-protector -fno-strict-aliasing -Wno-deprecated -std=c++11" -DCMAKE_EXE_LINKER_FLAGS:STRING=" -fstack-protector" -DCMAKE_MODULE_LINKER_FLAGS:STRING=" -fstack-protector" -DCMAKE_SHARED_LINKER_FLAGS:STRING=" -fstack-protector" -DCMAKE_INSTALL_PREFIX:PATH="/opt" -DCMAKE_BUILD_TYPE:STRING="Release" -DTHREADS_HAVE_PTHREAD_ARG:BOOL=YES -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=YES

> whats the full path of system SDL.h?

This question was answered: cmake is able to find it at configure-time.

Let me elaborate: on my system the location is /opt/include/SDL2/SDL.h. On a stock FreeBSD /usr/local is used instead of /opt, so it would be /usr/local/include/SDL2. But it does not matter, because, whatever the location is, spring's collection of cmake-files is able to find it -- it is just that the location is not always added to the compiler's include-path.

~0014304

abma (administrator)

> This question was answered: cmake is able to find it at configure-time.

no, it wasn't answered. in CMakeCache.txt, whats the value of SDL2_INCLUDE_DIR ? does it point to /opt/include/SDL2?

also, why is -DCUSTOM_CFLAGS:BOOL=true set? for me it looks like all parameters are from a very ancient version of spring. CUSTOM_CFLAGS doesn't exist any more. the cmake warning "Using custom CXX_FLAGS! this build will very likely not sync in online mode!" should NOT be ignored!!!

can freebsd compile with gcc? very likely when compiled with clang, it won't sync with gcc compiled spring.

~0014305

abma (administrator)

Last edited: 2015-04-09 03:40

View 2 revisions

> whatever the location is, spring's collection of cmake-files is able to find it -- it is just that the location is not always added to the compiler's include-path.

wrong:

https://github.com/spring/spring/blob/develop/rts/builds/legacy/CMakeLists.txt#L13

https://github.com/spring/spring/blob/develop/rts/builds/legacy/CMakeLists.txt#L82

(also side note: spring compiles on windows / linux / osx without any special hints to cmake, please stop guessing...)

~0014309

UnitedMarsupials (reporter)

> no, it wasn't answered.

I quoted the earlier answer. Why must you insist, white is black?

> in CMakeCache.txt, whats the value of SDL2_INCLUDE_DIR ?

This question has not been asked before. But you Here is the answer:

SDL2_INCLUDE_DIR:PATH=/opt/include/SDL2

> does it point to /opt/include/SDL2?

Yes. And you could've gotten this answer earlier, if you looked inside the spring-cmake-dot.txt , which I attached some 5 hours ago.

> wrong:

Those lines add SDL2-header locations to compiler in SOME cases. But not in ALL of them.

Once the bundled obsolete SDL2-headers are removed, the build breaks. The patch patch-use-system-sdl does the necesssary changes to have necessary flags on compiler's command-line everywhere.

I sense some irritation in your replies, so I'll just go away. Sorry to have disturbed your peace.

~0014310

UnitedMarsupials (reporter)

> also, why is -DCUSTOM_CFLAGS:BOOL=true set? for me it looks like all parameters > are from a very ancient version of spring.

Yes, indeed. The current (broken) version of FreeBSD port games/spring pulls in sources from 94.1. I'll be happy to clean-up the parameters.

> the cmake warning "Using custom CXX_FLAGS! this build will very likely
> not sync in online mode!" should NOT be ignored!!!

There is nothing special about the parameters -- everything on FreeBSD is compiled with such. If spring's code acts differently depending on optimization level, then it is broken :-(

> can freebsd compile with gcc? very likely when compiled with clang,
> it won't sync with gcc compiled spring.

As of release 10, FreeBSD standard base compiler is clang. Compiling with GNU is possible, but troublesome because, for example, Boost and Spring, apparently, must be compiled by the same compiler (whichever it is) and so on.

But all of the bundled tests pass, so, maybe, there is no need to worry?

~0014314

abma (administrator)

hm, we talked cross-purposes:

the included SDL.h is used when the headlessStubs is linked. so the benefit of using system installed SDL is just the code removal. but this pulles in the requirement for having SDL installed at build time when spring-headless & spring-dedicated is compiled.

when compiling "spring" the system installed sdl headers are used and libsdl is linked.

~0014317

abma (administrator)

i'm +1 for removing "duplicate" headers at the cost of adding the requirement for having SDL2 / glew / etc... libs installed at compile time.

afaik jk is one/the only one who is against removal of the headers, so the question goes to him:

any complains about removing these headers and not allow compile spring-headless / spring-dedicated without gfx-libraries installed?

afaik only in gentoo-packages this is used but in most cases the official static builds of spring/spring-dedicated/spring-headless could be used, so the need for allowing compile without SDL2+co installed is VERYVERY low.

~0014326

UnitedMarsupials (reporter)

Right. Having mock SDL.h may be fine, when ONLY the headless variant of spring is built (if it can not be helped, that SDL is required in such cases at all).

So it may make sense to keep the private copies of these headers around. But they should not be used, when compiling non-headless variant.

FreeBSD port always compiles both and so I took the liberty of simply excluding include/ at extract time. This allowed me to catch the few cases, where private headers were used without a good reason...
+Notes

-Issue History
Date Modified Username Field Change
2015-04-08 20:40 UnitedMarsupials New Issue
2015-04-08 20:45 abma Note Added: 0014292
2015-04-08 20:47 abma Note Edited: 0014292 View Revisions
2015-04-08 20:50 UnitedMarsupials Note Added: 0014293
2015-04-08 20:50 UnitedMarsupials Note Edited: 0014293 View Revisions
2015-04-08 20:57 abma Note Added: 0014295
2015-04-08 21:22 UnitedMarsupials Note Added: 0014298
2015-04-08 21:39 UnitedMarsupials Note Added: 0014299
2015-04-08 21:41 abma Note Added: 0014300
2015-04-08 21:43 abma Note Added: 0014301
2015-04-08 21:43 abma Assigned To => abma
2015-04-08 21:43 abma Status new => feedback
2015-04-08 21:45 abma Note Edited: 0014301 View Revisions
2015-04-08 21:45 abma Note Edited: 0014301 View Revisions
2015-04-08 21:46 abma Note Edited: 0014301 View Revisions
2015-04-08 21:49 UnitedMarsupials Note Added: 0014302
2015-04-08 21:49 UnitedMarsupials Status feedback => assigned
2015-04-08 21:53 UnitedMarsupials File Added: spring-cmake-dot.txt
2015-04-09 01:36 UnitedMarsupials File Added: patch-use-system-sdl
2015-04-09 03:33 abma Note Added: 0014304
2015-04-09 03:39 abma Note Added: 0014305
2015-04-09 03:40 abma Note Edited: 0014305 View Revisions
2015-04-09 06:32 UnitedMarsupials Note Added: 0014309
2015-04-09 06:37 UnitedMarsupials Note Added: 0014310
2015-04-09 09:29 abma Assigned To abma =>
2015-04-09 09:32 abma Note Added: 0014314
2015-04-09 09:32 abma Status assigned => new
2015-04-09 09:33 abma Severity minor => feature
2015-04-09 09:33 abma Category AI =>
2015-04-09 09:33 abma Summary sdlstub.c does not use system's <SDL.h> => remove include/* from spring repo
2015-04-09 10:31 abma Note Added: 0014317
2015-04-09 10:31 abma Assigned To => jK
2015-04-09 10:31 abma Status new => feedback
2015-04-09 10:37 abma Relationship added has duplicate 0004731
2015-04-09 15:36 UnitedMarsupials Note Added: 0014326
2015-04-09 15:36 UnitedMarsupials Status feedback => assigned
2016-01-13 14:33 abma Relationship added related to 0005033
2017-06-10 14:32 abma Relationship added related to 0005611
+Issue History