Skip to content

Commit

Permalink
build: force build for target x86_64 at the moment
Browse files Browse the repository at this point in the history
  • Loading branch information
shiqimei committed Jun 13, 2023
1 parent cb0cb71 commit db547f5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND LINK_LIBRARIES "m")
endif()

# set OSX arch to x86_64 eve if on M1
# TODO: support cross-compiling for M1, android etc.
# https://corrosion-rs.github.io/corrosion/usage.html
set(CMAKE_OSX_ARCHITECTURES x86_64)

# enable interprocedural optimization (IPO/LTO) if supported
include(CheckIPOSupported)
check_ipo_supported(RESULT supported OUTPUT error)
Expand Down
7 changes: 1 addition & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
set(COMPILE_FLAGS ${COMPILE_FLAGS} -O3)
endif()

add_custom_target(
RustLibs ALL
COMMAND cargo build $<$<CONFIG:Release>:--release>
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/crates/quickjs
)

add_library(quickjs
libbf.c
cutils.c
Expand Down Expand Up @@ -67,6 +61,7 @@ add_library(quickjs
core/misc/debug.c
)

# link quickjs rust library
corrosion_import_crate(MANIFEST_PATH ${CMAKE_SOURCE_DIR}/src/crates/Cargo.toml)
target_link_libraries(quickjs quickjs_rust)

Expand Down
2 changes: 1 addition & 1 deletion src/cli/qjsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#endif

#include "mimalloc.h"
#include "include/quickjs/cutils.h"
#include "quickjs/cutils.h"
#include "quickjs-libc.h"

typedef struct {
Expand Down

0 comments on commit db547f5

Please sign in to comment.