Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,28 @@ if(OS_MAC)
# Avoid CMP0042 policy errors.
set(CMAKE_MACOSX_RPATH 1)


if(NOT DEFINED PROJECT_ARCH)
message(STATUS "PROJECT_ARCH not defined. Detecting machine architecture.")
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
set(PROJECT_ARCH arm64)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
set(PROJECT_ARCH x86_64)
else()
message(FATAL_ERROR "Unsupported machine architecture: ${CMAKE_SYSTEM_PROCESSOR}. Please specify the target architecture using -DPROJECT_ARCH=<arch>")
endif()
endif()

message(STATUS "Building for architecture: ${PROJECT_ARCH}")

if(PROJECT_ARCH STREQUAL "x86_64")
set(CMAKE_OSX_ARCHITECTURES x86_64)
elseif(PROJECT_ARCH STREQUAL "arm64")
set(CMAKE_OSX_ARCHITECTURES arm64)
else()
message(FATAL_ERROR "Unsupported architecture: ${PROJECT_ARCH}")
endif()

# Avoid CMP0068 policy errors.
if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW)
Expand Down Expand Up @@ -370,7 +392,20 @@ if(OS_MAC)
MACOSX_BUNDLE_INFO_PLIST ${_helper_info_plist}
OUTPUT_NAME ${_helper_output_name}
)

set_target_properties(${JCEF_TARGET} PROPERTIES
# XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO"
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ${ENACTOR_CODE_SIGN_IDENTITY}
XCODE_ATTRIBUTE_DEVELOPMENT_TEAM ${ENACTOR_DEVELOPMENT_TEAM}
# XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME "YES"
# XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--deep"
)
set_target_properties(${JCEF_HELPER_TARGET} PROPERTIES
# XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO"
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ${ENACTOR_CODE_SIGN_IDENTITY}
XCODE_ATTRIBUTE_DEVELOPMENT_TEAM ${ENACTOR_DEVELOPMENT_TEAM}
# XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME "YES"
# XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--deep"
)
if(USE_SANDBOX)
target_link_libraries(${_helper_target} cef_sandbox_lib)
endif()
Expand Down
186 changes: 181 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -722,12 +722,12 @@
</plugins>
</build>
</profile>

<profile>
<id>generate-mac</id>
<id>generate-mac-amd64</id>
<activation>
<os>
<family>mac</family>
<arch>x86_64</arch>
</os>
</activation>
<properties>
Expand All @@ -753,11 +753,14 @@
<environmentVariables>
</environmentVariables>
<options>
<option>-DPROJECT_ARCH=x86_64</option>
<option>-DCMAKE_BUILD_TYPE=Release</option>
<option>-DJCEF_VERSION=${project.version}</option>
<option>-DJCEF_COMMIT_NUMBER=${git.total.commit.count}</option>
<option>-DJCEF_COMMIT_HASH=${git.commit.id}</option>
</options>
<option>-DENACTOR_CODE_SIGN_IDENTITY=${enactor.code.sign.identity}</option>
<option>-DENACTOR_DEVELOPMENT_TEAM=${enactor.development.team}</option>
</options>
</configuration>
</execution>
<execution>
Expand Down Expand Up @@ -839,7 +842,7 @@
</execution>
</executions>
<configuration>
<finalName>chromium-binaries-mac</finalName>
<finalName>chromium-binaries-${distribution.arch}</finalName>
<descriptors>
<descriptor>assemble-mac-os.xml</descriptor>
</descriptors>
Expand Down Expand Up @@ -876,7 +879,7 @@
<goal>deploy-file</goal>
</goals>
<configuration>
<file>${basedir}/target/chromium-binaries-mac.zip</file>
<file>${basedir}/target/chromium-binaries-${distribution.arch}.zip</file>
<repositoryId>${repository.id}</repositoryId>
<url>${repository.url}</url>
<groupId>com.enactor.chromium</groupId>
Expand All @@ -890,6 +893,179 @@
</plugins>
</build>
</profile>
<profile>
<id>generate-mac-arm64</id>
<activation>
<os>
<family>mac</family>
<arch>arm64</arch>
</os>
</activation>
<properties>
<distribution.folder>macosx64</distribution.folder>
<distribution.arch>macos-arm64</distribution.arch>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.googlecode.cmake-maven-project</groupId>
<artifactId>cmake-maven-plugin</artifactId>
<executions>
<execution>
<id>cmake-generate-mac</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<sourcePath>${basedir}</sourcePath>
<targetPath>${basedir}/jcef_build</targetPath>
<generator>Xcode</generator>
<classifier>mac-x86_64</classifier>
<environmentVariables>
</environmentVariables>
<options>
<option>-DPROJECT_ARCH=arm64</option>
<option>-DCMAKE_BUILD_TYPE=Release</option>
<option>-DJCEF_VERSION=${project.version}</option>
<option>-DJCEF_COMMIT_NUMBER=${git.total.commit.count}</option>
<option>-DJCEF_COMMIT_HASH=${git.commit.id}</option>
<option>-DENACTOR_CODE_SIGN_IDENTITY=${enactor.code.sign.identity}</option>
<option>-DENACTOR_DEVELOPMENT_TEAM=${enactor.development.team}</option>
</options>
</configuration>
</execution>
<execution>
<id>cmake-compile-mac</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<config>Release</config>
<projectDirectory>${basedir}/jcef_build</projectDirectory>
<classifier>mac-x86_64</classifier>
<environmentVariables>
</environmentVariables>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>package</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<exec dir="${basedir}/tools" executable="/bin/bash">
<arg value="make_distrib.sh" />
<arg value="macosx64" />
</exec>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<executions>
<execution>
<id>deploy-jcef</id>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>${basedir}/jcef_build/native/Release/jcef.jar/</file>
<groupId>com.enactor.core</groupId>
<artifactId>jcef</artifactId>
<version>${project.version}</version>
<packaging>jar</packaging>
</configuration>
</execution>
<execution>
<id>deploy-jcef-test</id>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>${basedir}/jcef_build/native/Release/jcef-tests.jar/</file>
<groupId>com.enactor.core</groupId>
<artifactId>jcef-tests</artifactId>
<version>${project.version}</version>
<packaging>jar</packaging>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<finalName>chromium-binaries-${distribution.arch}</finalName>
<descriptors>
<descriptor>assemble-mac-os.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>${skip.deploy}</skip>
</configuration>
<executions>
<execution>
<id>deploy-jcef</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<file>${basedir}/jcef_build/native/Release/jcef.jar</file>
<repositoryId>${repository.id}</repositoryId>
<url>${repository.url}</url>
<groupId>com.enactor.core</groupId>
<artifactId>jcef</artifactId>
<version>${project.version}</version>
<packaging>jar</packaging>
</configuration>
</execution>
<execution>
<id>deploy-native-binaries</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<file>${basedir}/target/chromium-binaries-${distribution.arch}.zip</file>
<repositoryId>${repository.id}</repositoryId>
<url>${repository.url}</url>
<groupId>com.enactor.chromium</groupId>
<artifactId>mac-binaries</artifactId>
<version>${project.version}</version>
<packaging>zip</packaging>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>


</profiles>
<dependencies>
<dependency>
Expand Down