We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1955 - CMakeLists.txt doesn't pull in src/thread/windows/SDL_systls.c
Summary: CMakeLists.txt doesn't pull in src/thread/windows/SDL_systls.c
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: 2.0.0
Hardware: x86_64 Windows 7
: P2 major
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-10 18:01 UTC by Charles Huber
Modified: 2013-07-10 23:44 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Charles Huber 2013-07-10 18:01:04 UTC
Working from SDL-2.0.0-7392.zip.

A CMake-generated x64 VS2012 shared-library project fails to link with:

2>SDL_thread.obj : error LNK2019: unresolved external symbol SDL_TLSCreate referenced in function SDL_GetErrBuf
2>SDL_thread.obj : error LNK2019: unresolved external symbol SDL_TLSGet referenced in function SDL_GetErrBuf
2>SDL_thread.obj : error LNK2019: unresolved external symbol SDL_TLSSet referenced in function SDL_GetErrBuf

Looks like there should be an extra line in CMakeLists.txt around line 797, something like this:

  if(SDL_THREADS)
    set(SDL_THREAD_WINDOWS 1)
    set(SOURCE_FILES ${SOURCE_FILES}
      ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_sysmutex.c
      ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_syssem.c
      ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_systhread.c
      # add this line:
      ${SDL2_SOURCE_DIR}/src/thread/windows/SDL_systls.c      
      ${SDL2_SOURCE_DIR}/src/thread/generic/SDL_syscond.c)
    set(HAVE_SDL_THREADS TRUE)
  endif(SDL_THREADS)
Comment 1 Ryan C. Gordon 2013-07-10 23:44:05 UTC
Fixed in hg changeset c1b80390a820, thanks!

--ryan.