forked from ProjectSkyfire/SkyFire.406a
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Applied a few cmake updates from TC. Should fix the blank version has…
…h inside the core. Signed-off-by: SkyFire <[email protected]>
- Loading branch information
Showing
12 changed files
with
169 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright (C) 2011-2013 Project SkyFire <http://www.projectskyfire.org/> | ||
# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> | ||
# | ||
# This file is free software; as a special exception the author gives | ||
# unlimited permission to copy and/or distribute it, with or without | ||
# modifications, as long as this notice is preserved. | ||
# | ||
# This program is distributed in the hope that it will be useful, but | ||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the | ||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
|
||
# Set build-directive (used in core to tell which buildtype we used) | ||
add_definitions(-D_BUILD_DIRECTIVE='"$(CONFIGURATION)"') | ||
|
||
if(WITH_WARNINGS) | ||
set(WARNING_FLAGS "-W -Wall -Wextra -Winit-self -Wfatal-errors") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} -Woverloaded-virtual") | ||
message(STATUS "Clang: All warnings enabled") | ||
endif() | ||
|
||
if(WITH_COREDEBUG) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3") | ||
message(STATUS "Clang: Debug-flags set (-g3)") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright (C) 2011-2013 Project SkyFire <http://www.projectskyfire.org/> | ||
# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> | ||
# | ||
# This file is free software; as a special exception the author gives | ||
# unlimited permission to copy and/or distribute it, with or without | ||
# modifications, as long as this notice is preserved. | ||
# | ||
# This program is distributed in the hope that it will be useful, but | ||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the | ||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
|
||
# set up output paths for executable binaries (.exe-files, and .dll-files on DLL-capable platforms) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
|
||
# Set build-directive (used in core to tell which buildtype we used) | ||
add_definitions(-D_BUILD_DIRECTIVE=\\"${CMAKE_BUILD_TYPE}\\") | ||
|
||
if(PLATFORM EQUAL 32) | ||
# Required on 32-bit systems to enable SSE2 (standard on x64) | ||
set(SSE_FLAGS "-msse2 -mfpmath=sse") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SSE_FLAGS}") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SSE_FLAGS}") | ||
endif() | ||
add_definitions(-DHAVE_SSE2 -D__SSE2__) | ||
message(STATUS "GCC: SFMT enabled, SSE2 flags forced") | ||
|
||
if( WITH_WARNINGS ) | ||
set(WARNING_FLAGS "-W -Wall -Wextra -Winit-self -Winvalid-pch -Wfatal-errors") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNING_FLAGS} -Woverloaded-virtual") | ||
message(STATUS "GCC: All warnings enabled") | ||
endif() | ||
|
||
if( WITH_COREDEBUG ) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3") | ||
message(STATUS "GCC: Debug-flags set (-g3)") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Copyright (C) 2011-2013 Project SkyFire <http://www.projectskyfire.org/> | ||
# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> | ||
# | ||
# This file is free software; as a special exception the author gives | ||
# unlimited permission to copy and/or distribute it, with or without | ||
# modifications, as long as this notice is preserved. | ||
# | ||
# This program is distributed in the hope that it will be useful, but | ||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the | ||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
|
||
include(${CMAKE_SOURCE_DIR}/cmake/macros/EnsureVersion.cmake) | ||
|
||
set(_REQUIRED_GIT_VERSION "1.7") | ||
|
||
find_program(GIT_EXECUTABLE | ||
NAMES | ||
git git.cmd | ||
HINTS | ||
ENV PATH | ||
DOC "Full path to git commandline client" | ||
) | ||
MARK_AS_ADVANCED(GIT_EXECUTABLE) | ||
|
||
if(NOT GIT_EXECUTABLE) | ||
message(FATAL_ERROR " | ||
Git was NOT FOUND on your system - did you forget to install a recent version, or setting the path to it? | ||
Observe that for revision hash/date to work you need at least version ${_REQUIRED_GIT_VERSION}") | ||
else() | ||
message(STATUS "Found git binary : ${GIT_EXECUTABLE}") | ||
execute_process( | ||
COMMAND "${GIT_EXECUTABLE}" --version | ||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" | ||
OUTPUT_VARIABLE _GIT_VERSION | ||
ERROR_QUIET | ||
) | ||
|
||
# make sure we're using minimum the required version of git, so the "dirty-testing" will work properly | ||
ensure_version( "${_REQUIRED_GIT_VERSION}" "${_GIT_VERSION}" _GIT_VERSION_OK) | ||
|
||
# throw an error if we don't have a recent enough version of git... | ||
if(NOT _GIT_VERSION_OK) | ||
message(STATUS "Git version too old : ${_GIT_VERSION}") | ||
message(FATAL_ERROR " | ||
Git was found but is OUTDATED - did you forget to install a recent version, or setting the path to it? | ||
Observe that for revision hash/date to work you need at least version ${_REQUIRED_GIT_VERSION}") | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* Copyright (C) 2009 Sun Microsystems, Inc | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; version 2 of the License. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ | ||
|
||
/* Check stack direction (0-down, 1-up) */ | ||
int f(int *a) | ||
{ | ||
int b; | ||
return(&b > a)?1:0; | ||
} | ||
/* | ||
Prevent compiler optimizations by calling function | ||
through pointer. | ||
*/ | ||
volatile int (*ptr_f)(int *) = f; | ||
int main() | ||
{ | ||
int a; | ||
return ptr_f(&a); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters