Permalink
Browse files

Merge branch 'master' of github.com:senchalabs/hammerjs

  • Loading branch information...
2 parents 83ce199 + aae180f commit 72b77c2c54229f655e395a85ebc3483aa192e369 Ariya Hidayat committed Jun 17, 2011
Showing with 18 additions and 9 deletions.
  1. +16 −0 CMakeLists.txt
  2. +1 −1 modules/fs/fs.cpp
  3. +1 −8 v8/CMakeLists.txt
View
@@ -5,6 +5,10 @@ project(HammerJS)
# FIXME: this should detect 64-bit vs 32-bit architecture instead
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(HAMMERJS_ARCH "x64")
+ add_definitions(-mmacosx-version-min=10.5)
+ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -mmacosx-version-min=10.5")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -mmacosx-version-min=10.5")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mmacosx-version-min=10.5")
else()
set(HAMMERJS_ARCH "ia32")
endif()
@@ -16,12 +20,24 @@ if(CMAKE_COMPILER_IS_GNUCXX )
add_definitions(-Wall)
endif(CMAKE_COMPILER_IS_GNUCXX )
+if(MSVC)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
+endif(MSVC)
+
include_directories(${PROJECT_SOURCE_DIR}/v8/include)
add_executable(hammerjs hammerjs.cpp)
if(${HAMMERJS_ARCH} MATCHES "x64")
+ set_target_properties(hammerjs PROPERTIES COMPILE_FLAGS "-m64" LINK_FLAGS "-m64")
+ set_target_properties(hammerjs_reflect PROPERTIES COMPILE_FLAGS "-m64" LINK_FLAGS "-m64")
+ set_target_properties(hammerjs_system PROPERTIES COMPILE_FLAGS "-m64" LINK_FLAGS "-m64")
+ set_target_properties(hammerjs_fs PROPERTIES COMPILE_FLAGS "-m64" LINK_FLAGS "-m64")
set_target_properties(v8 PROPERTIES COMPILE_FLAGS "-m64" LINK_FLAGS "-m64")
else()
+ set_target_properties(hammerjs PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
+ set_target_properties(hammerjs_reflect PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
+ set_target_properties(hammerjs_system PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
+ set_target_properties(hammerjs_fs PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
set_target_properties(v8 PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
endif()
View
@@ -261,7 +261,7 @@ static Handle<Value> stream_constructor(const Arguments& args)
std::fstream *data = new std::fstream;
data->open(*name, mode);
- if (data->bad()) {
+ if (data->fail() || data->bad()) {
delete data;
return ThrowException(String::New("Exception: Can't open the file"));
}
View
@@ -170,7 +170,6 @@ endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(V8_SOURCES ${V8_SOURCES} src/platform-macos.cc)
- add_definitions(-mmacosx-version-min=10.4)
add_definitions(-ansi)
add_definitions(-O3)
endif()
@@ -192,10 +191,4 @@ if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-Wno-uninitialized -fomit-frame-pointer -fdata-sections -ffunction-sections)
endif(CMAKE_COMPILER_IS_GNUCXX)
-add_library(v8 STATIC ${V8_SOURCES})
-
-if(${HAMMERJS_ARCH} MATCHES "x64")
- set_target_properties(v8 PROPERTIES COMPILE_FLAGS "-m64" LINK_FLAGS "-m64")
-else()
- set_target_properties(v8 PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
-endif()
+add_library(v8 STATIC ${V8_SOURCES})

0 comments on commit 72b77c2

Please sign in to comment.