Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Round 2 of windows changes #53

Merged
merged 13 commits into from
Apr 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ src/vogleditor/ui_vogleditor*
vogl_build/*
voglinc/
*~

_out*/
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ if (NOT WIN32)
find_package(LibLZMA REQUIRED)
endif()

# Always look. It won't be found on Windows. Later build scripts will understand how to
# WAR it being missing.
find_package(TinyXML)

message("")
Expand All @@ -37,13 +39,14 @@ message("")
### All of these must be included eventually.
add_subdirectory(src/voglcore) # 1
add_subdirectory(src/voglgen) # 2
add_subdirectory(src/voglcommon) # 3
add_subdirectory(src/vogltrace) # 7

if (NOT WIN32)
add_subdirectory(src/voglcommon) # 3
add_subdirectory(src/voglreplay) # 4
add_subdirectory(src/voglbench) # 5
add_subdirectory(src/voglsyms) # 6
add_subdirectory(src/vogltrace) # 7

add_subdirectory(src/vogltest) # 8
add_subdirectory(src/voglserver) # 9
add_subdirectory(src/voglcmd) # 10
Expand Down
Empty file added glspec/force_regenerate
Empty file.
69 changes: 50 additions & 19 deletions src/build_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,14 @@ if (BUILD_X64 STREQUAL "")
endif()
endif()

if (BUILD_X64 AND MSVC)
# TODO: I don't know how to get a 64-bit build generated from MSVC yet.
set(BUILD_X64 "FALSE")
endif()

# Generate bitness suffix to use, but make sure to include the existing suffix (.exe)
# for platforms that need it (ie, Windows)
if (BUILD_X64)
set(CMAKE_EXECUTABLE_SUFFIX "64${CMAKE_EXECUTABLE_SUFFIX}")
set(CMAKE_SHARED_LIBRARY_SUFFIX "64.so")
set(CMAKE_SHARED_LIBRARY_SUFFIX "64${CMAKE_SHARED_LIBRARY_SUFFIX}")
else()
set(CMAKE_EXECUTABLE_SUFFIX "32${CMAKE_EXECUTABLE_SUFFIX}")
set(CMAKE_SHARED_LIBRARY_SUFFIX "32.so")
set(CMAKE_SHARED_LIBRARY_SUFFIX "32${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()

# Default to release build
Expand Down Expand Up @@ -268,14 +263,14 @@ endif()


if (NOT MSVC)
set(CMAKE_EXE_LINK_FLAGS_LIST
"-Wl,--no-undefined"
# "-lmcheck"
)

set(CMAKE_SHARED_LINK_FLAGS_LIST
"-Wl,--no-undefined"
)
set(CMAKE_EXE_LINK_FLAGS_LIST
"-Wl,--no-undefined"
# "-lmcheck"
)

set(CMAKE_SHARED_LINK_FLAGS_LIST
"-Wl,--no-undefined"
)
endif()

# Compiler flags
Expand Down Expand Up @@ -361,7 +356,37 @@ function(require_pthreads)
# Export the variable to the parent scope so the linker knows where to find the library.
set(CMAKE_THREAD_LIBS_INIT ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE)
endif()
endfunction()

function(require_libjpegturbo)
find_library(LibJpegTurbo_LIBRARY
NAMES libturbojpeg.so libturbojpeg.so.0 libturbojpeg.dylib
PATHS /opt/libjpeg-turbo/lib
)

# On platforms that find this, the include files will have also been installed to the system
# so we don't need extra include dirs.
if (LibJpegTurbo_LIBRARY)
set(LibJpegTurbo_INCLUDE "" PARENT_SCOPE)
else()
if (BUILD_X64)
set(BITS_STRING "x64")
else()
set(BITS_STRING "x86")
endif()
set(LibJpegTurbo_INCLUDE "${CMAKE_PREFIX_PATH}/libjpeg-turbo-2.1.3/include" PARENT_SCOPE)
set(LibJpegTurbo_LIBRARY "${CMAKE_PREFIX_PATH}/libjpeg-turbo-2.1.3/lib_${BITS_STRING}/turbojpeg.lib" PARENT_SCOPE)
endif()
endfunction()

function(request_backtrace)
if (NOT MSVC)
set( LibBackTrace_INCLUDE "${SRC_DIR}/libbacktrace" PARENT_SCOPE )
set( LibBackTrace_LIBRARY "backtracevogl" PARENT_SCOPE )
else()
set( LibBackTrace_INCLUDE "" PARENT_SCOPE )
set( LibBackTrace_LIBRARY "" PARENT_SCOPE )
endif()
endfunction()

# What compiler toolchain are we building on?
Expand Down Expand Up @@ -412,11 +437,17 @@ if (MSVC)
# And in release we use the DLL release runtime
add_compiler_flag_release("/MD")

# In debug, get debug information suitable for Edit and Continue
add_compiler_flag_debug("/ZI")
# x64 doesn't ever support /ZI, only /Zi.
if (BUILD_X64)
add_compiler_flag("/Zi")
else()

# In release, still generate debug information (because not having it is dumb)
add_compiler_flag_release("/Zi")
# In debug, get debug information suitable for Edit and Continue
add_compiler_flag_debug("/ZI")

# In release, still generate debug information (because not having it is dumb)
add_compiler_flag_release("/Zi")
endif()

# And tell the linker to always generate the file for us.
add_linker_flag("/DEBUG")
Expand Down
Loading