diff options
author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-11-18 01:05:12 +0000 |
---|---|---|
committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-11-18 01:05:12 +0000 |
commit | da8a1c7b6068dcc079d6f710a877ed53fabff86f (patch) | |
tree | 599684a3661fa346705d768568bf1e5d5b71f770 /src/CMakeLists.txt | |
parent | e10fe1cd767cf479837eecc1e1b26615d63ea5ac (diff) |
Remove some CoreExports and add them in other places, fixed a few minor warnings under Windows build, made Windows build create a static library out of win32_memory.cpp and use that with everything instead of relying on it being compiled into everything (saves compiling time).
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2656 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9641a4ad2..a6343e8c3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,10 +2,8 @@ file(GLOB SRC_SRCS_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c") file(GLOB SRC_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp") set(SRC_SRCS ${SRC_SRCS_C} ${SRC_SRCS_CPP}) -# If not using Visual Studio, don't include win32_memory.cpp, it's only required by Visual Studio to override it's override of the new/delete operators -if(NOT MSVC) - remove_item_from_list(SRC_SRCS win32_memory.cpp) -endif(NOT MSVC) +# Don't include win32_memory.cpp, it's only required by Visual Studio to override it's override of the new/delete operators +remove_item_from_list(SRC_SRCS win32_memory.cpp) # If not using Windows, don't include windows.cpp, as it's Windows-specific if(NOT WIN32) remove_item_from_list(SRC_SRCS windows.cpp) @@ -54,12 +52,21 @@ if(WIN32) endif(MINGW) endif(WIN32) +# If compiling with Visual Studio, create a static library out of win32_memory.cpp to be included with everything else, needed to override it's override of new/delete operators +if(MSVC) + set_source_files_properties(win32_memory.cpp PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}") + add_library(win32_memory STATIC win32_memory.cpp) + set(WIN32_MEMORY win32_memory) +else(MSVC) + set(WIN32_MEMORY) +endif(MSVC) + # Generate the Anope executable and set it's linker flags, also set it to export it's symbols even though it's not a module add_executable(${PROGRAM_NAME} ${SRC_SRCS}) set_target_properties(${PROGRAM_NAME} PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}" ENABLE_EXPORTS ON) # On Windows, also link Anope to the wsock32 library, as well as set the version if(WIN32) - target_link_libraries(${PROGRAM_NAME} wsock32) + target_link_libraries(${PROGRAM_NAME} wsock32 ${WIN32_MEMORY}) set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}") endif(WIN32) # Building the Anope executable requires the language files to be compiled first as well as the version.h header to be generated |