Skip to content

Commit

Permalink
Clean up CMake stuff; remove profile on OSX.
Browse files Browse the repository at this point in the history
profile on OSX is deprecated and does not work anymore.
  • Loading branch information
krono committed Sep 19, 2012
1 parent e18fb4d commit 940dd01
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 73 deletions.
13 changes: 9 additions & 4 deletions CMakeLists.txt
@@ -1,10 +1,15 @@
#!/bin/env cmake

# This is for a cmake compatibility check
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.4)
message(FATAL_ERROR "${PROJECT_NAME} requires at least CMake v2.8")
# Prologue
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.4) # old style:
message(FATAL_ERROR "${PROJECT_NAME} requires at least CMake v2.8, you use v${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.")
endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.4)
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
if(APPLE)
cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR) # it has to be 2.8.8 on OSX
set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES i386)
else()
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
endif()

project(SelfDistribution)

Expand Down
20 changes: 4 additions & 16 deletions vm/CMakeLists.txt
@@ -1,33 +1,21 @@
#!/usr/bin/env cmake
set(PROJECT_NAME Self)

#
#
# Prologue
#

# This is for a cmake compatibility check
# old style:
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.4)
message(FATAL_ERROR "${PROJECT_NAME} requires at least CMake v2.8"
" You are running v${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}."
" Please upgrade." )
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.4) # old style:
message(FATAL_ERROR "${PROJECT_NAME} requires at least CMake v2.8, you use v${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.")
endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.4)
# new style:
if(APPLE)
# it has to be 2.8.8 on OSX
cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR) # it has to be 2.8.8 on OSX
set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES i386)
else()
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
endif()


#
# Actual start.
#
#
#
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

project(${PROJECT_NAME} C CXX ASM)
Expand Down Expand Up @@ -56,7 +44,7 @@ source_group("glue" FILES ${SRC_glue} "${CMAKE_CURRENT_SOURCE_DIR}/src/")

list(APPEND SRC ${SRC_src} ${SRC_glue})

# get platform-dependent configuratio
# get platform-dependent configuration
# sets
# $GUI_TYPE
# $EXTRA_LIBRARIES
Expand Down
11 changes: 11 additions & 0 deletions vm/cmake/common.cmake
Expand Up @@ -20,6 +20,17 @@ option(SELF_PROFILE "Select whether to do a profiled build" OFF)
option(SELF_COVERAGE "Select whether to do a coverage build" OFF)
option(SELF_FAST_FLOATS "Select whether to do a build with fast floats" OFF)

# do not use X11 on OSX by default.
if(APPLE)
set(SELF_X11_INIT OFF)
option(SELF_QUARTZ "Select whether to build Self with Quartz Platform windows" ON)
else()
set(SELF_X11_INIT ON)
endif()

option(SELF_X11 "Select whether to build Self with X11 Platform windows" ${SELF_X11_INIT})


set(
SELF_GLUE_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}/../objects/glue"
Expand Down
15 changes: 8 additions & 7 deletions vm/cmake/mac_osx.cmake
@@ -1,7 +1,7 @@
#!/usr/bin/env cmake
if(NOT APPLE)
message(FATAL_ERROR "This is only for Mac OS X")
endif(NOT APPLE)
endif()

if((CMAKE_GENERATOR MATCHES Xcode) AND ((XCODE_VERSION VERSION_LESS "4") AND (clang)))
message("WARNING: Self on Xcode 3 does not work with Clang.
Expand All @@ -11,9 +11,11 @@ endif()

set(SELF_OSX_INFO_PLIST Info)

# do not use X11 on OSX by default.
set(SELF_X11_INIT OFF)
option(SELF_QUARTZ "Select whether to build Self with Quartz Platform windows" ON)
if(SELF_QUARTZ)
message(STATUS "Using Quartz plaform windows.")
list(APPEND _defines -DQUARTZ_LIB)
endif()

option(SELF_OSX_COCOA "EXPERIMENTAL: Build with the Cocoa console" OFF)
if(SELF_OSX_COCOA)
list(APPEND _defines -DCOCOA_EXP)
Expand Down Expand Up @@ -96,8 +98,7 @@ list(APPEND EXTRA_LIBRARIES ${frameworks})
# Mac compile definitons, independent of generator
#
list(APPEND _defines
-DDEBUG # ?? this is straight from mac_osx.make
-DGCC3=1 #lets see if we can live withiout it
# -DGCC3=1 #lets see if we can live withiout it
-DGLUE_CHECKSUM=0
)

Expand Down Expand Up @@ -212,7 +213,7 @@ macro(setup_target target)
endif()

set(CMAKE_XCODE_ATTRIBUTE_COPY_PHASE_STRIP "NO")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym")

# cmake adds warnings hardcoded which we dont want.
# mess with the warnings
Expand Down
35 changes: 17 additions & 18 deletions vm/cmake/policies.cmake
@@ -1,22 +1,21 @@
#!/usr/bin/env cmake

# Policies, partly from osg
if(COMMAND cmake_policy)
# Works around warnings libraries linked against that don't
# have absolute paths (e.g. -lpthreads)
cmake_policy(SET CMP0003 NEW)

cmake_policy(SET CMP0007 NEW) #empty list handling

# tell CMake to prefer CMake's own CMake modules when available
# only available from cmake-2.8.4
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 3)
cmake_policy(SET CMP0017 NEW)
endif()
# Works around warnings libraries linked against that don't
# have absolute paths (e.g. -lpthreads)
cmake_policy(SET CMP0003 NEW)

# cmake-2.6.1 introduces policy cmp0008 decide how to treat full path libraries that do not appear to be valid library file names
# quote from cvslog "Such libraries worked by accident in the VS IDE and Xcode generators in CMake 2.4 and below."
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4 AND ${CMAKE_PATCH_VERSION} GREATER 0)
cmake_policy(SET CMP0008 OLD)
endif()

cmake_policy(SET CMP0007 NEW) #empty list handling

# tell CMake to prefer CMake's own CMake modules when available
# only available from cmake-2.8.4
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 3)
cmake_policy(SET CMP0017 NEW)
endif()

# cmake-2.6.1 introduces policy cmp0008 decide how to treat full path libraries that do not appear to be valid library file names
# quote from cvslog "Such libraries worked by accident in the VS IDE and Xcode generators in CMake 2.4 and below."
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4 AND ${CMAKE_PATCH_VERSION} GREATER 0)
cmake_policy(SET CMP0008 OLD)
endif()

6 changes: 1 addition & 5 deletions vm/cmake/setup.cmake
Expand Up @@ -2,13 +2,9 @@
#
# setup all necessary build definition variables
#
option(SELF_X11 "Select whether to build Self with X11 Platform windows" ${SELF_X11_INIT})

if(SELF_QUARTZ)
list(APPEND _defines -DQUARTZ_LIB)
endif()

if(SELF_X11)
message(STATUS "Using X11 plaform windows.")
list(APPEND _defines -DXLIB)
endif()

Expand Down
2 changes: 1 addition & 1 deletion vm/cmake/setupVmDate.cmake
@@ -1,7 +1,7 @@
#!/usr/bin/env cmake
#
# out:
# $SRC_VMDATE
# $SRC_VMDATE
#
# in:
# $SELF_BUILD_SUPPORT_DIR
Expand Down
26 changes: 13 additions & 13 deletions vm/src/CMakeLists.txt
Expand Up @@ -625,32 +625,32 @@ set(SRC_unix

# include unix files
if(UNIX)
list(APPEND SRC_src ${SRC_unix})
list(APPEND SRC_src ${SRC_unix})
endif(UNIX)


set(SRC_x11
any/os/xlibWindow.cpp
any/os/xlibWindow.hh
unix/prims/x_includes.hh
unix/prims/xlibPrims.cpp
unix/prims/xlibPrims.hh
any/os/xlibWindow.cpp
any/os/xlibWindow.hh
unix/prims/x_includes.hh
unix/prims/xlibPrims.cpp
unix/prims/xlibPrims.hh
)

if(SELF_X11)
list(APPEND SRC_src ${SRC_x11})
list(APPEND SRC_src ${SRC_x11})
endif()

set(SRC_quartz
any/prims/prim_table_quartz.hh
any/prims/quartzPrims.cpp
any/prims/quartzPrims.hh
any/os/quartzWindow.cpp
any/os/quartzWindow.hh
any/prims/prim_table_quartz.hh
any/prims/quartzPrims.cpp
any/prims/quartzPrims.hh
any/os/quartzWindow.cpp
any/os/quartzWindow.hh
)

if(SELF_QUARTZ)
list(APPEND SRC_src ${SRC_quartz})
list(APPEND SRC_src ${SRC_quartz})
endif()


Expand Down
25 changes: 16 additions & 9 deletions vm/src/any/zone/fprofiler.cpp
Expand Up @@ -16,22 +16,29 @@
# define scale(offset) ((offset >> SHIFT) / sizeof(PCounter))


# if TARGET_OS_FAMILY == UNIX_FAMILY

# if TARGET_OS_FAMILY == MACOS_FAMILY \
|| (defined(OSX_RELEASE) && OSX_RELEASE > LION_RELEASE)

//void profil( unsigned short* /*buf*/,
// unsigned int /*bufsiz*/,
// int /*offset*/,
// unsigned int /*scale*/ ) {
// fatal("unimp mac");
//}

#define profil(buf,bufsiz,offset,scale) fatal("unimp mac: profil(2) not supported")

# else
/* Pick this up from header file:
extern "C" void profil(unsigned short *buf,
unsigned int bufsiz,
unsigned int offset,
unsigned int scale);
*/

# elif TARGET_OS_FAMILY == MACOS_FAMILY
void profil( unsigned short* /*buf*/,
unsigned int /*bufsiz*/,
int /*offset*/,
unsigned int /*scale*/ ) {
fatal("unimp mac");
}
# endif




FlatProfiler* flatProfiler;
Expand Down

0 comments on commit 940dd01

Please sign in to comment.